Ericsson / clang

Cross Translation Unit analysis capability for Clang Static Analyzer. (Fork of official clang at http://llvm.org/git/clang)
http://clang.llvm.org/
Other
15 stars 10 forks source link

Remove use of makeDeclVisibleInContext #566

Closed martong closed 5 years ago

martong commented 5 years ago

In the past we had to use DeclContext::makeDeclVisibleInContext to make friend declarations available for subsequent lookup calls and this way we could chain (redecl) the structurally equivalent decls. Since we use the importer specific lookup this is no longer necessary, because with that we can find every previous nodes.

balazske commented 5 years ago

It seems that we do not know exactly what to put into the lookup table in these cases. The table should be correct not only for the purpose of ASTImporter (do not change contents of it only to make ASTImporter work).

martong commented 5 years ago

The table should be correct not only for the purpose of ASTImporter (do not change contents of it only to make ASTImporter work).

Yes, exactly. We used to abuse the normal lookup and put otherwise nonvisible decls into the normal lookup table, merely for the purpose of ASTImporter.

gamesh411 commented 5 years ago

This seems the right way to handle friends, ASTImport logic should be self-enclosed, and the observed behaviour unaltered with respect to other consumers of the produced AST.