This is an archive of the discontinued LLVM Phabricator instance.

[ASTImporter] Lookup SearchName instead of Name
ClosedPublic

Authored by szepet on Mar 12 2017, 4:56 PM.

Details

Summary

When the SearchName is already calculated we should use that for the lookup.
That is why the check for a found TypedefNameDecl can be relevant in the for loop and we (probably) have to iterate over fewer decls.
I havent added test cases because it does not produce a bug since in the isStrucuralMatch function calls to the StructuralEquivalenceContext::Finish() function and in case of unnamed decls it checks for TypeDefName and returns false (without any warning message).

Diff Detail

Repository
rL LLVM

Event Timeline

szepet created this revision.Mar 12 2017, 4:56 PM
a.sidorin edited edge metadata.Mar 18 2017, 6:23 AM

Looks good. Thank you!
Could you try to write a test using the fact that new code covers typedefs for anonymous structures?

szepet updated this revision to Diff 92408.Mar 20 2017, 5:34 PM

Test case added.

LGTM, thank you!

a.sidorin accepted this revision.Mar 20 2017, 6:12 PM
This revision is now accepted and ready to land.Mar 20 2017, 6:12 PM
This revision was automatically updated to reflect the committed changes.