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

Add/remove from the Lookuptable consistently #592

Closed martong closed 5 years ago

martong commented 5 years ago

Add/remove from the Lookuptable in consistency with ImportedFromDecls. When we map a decl in the 'to' context to something in the 'from' context then and only then we add it to the lookup table. When we remove a mapping then and only then we remove it from the lookup table.

balazske commented 5 years ago

The change is OK. Probably a better solution is to include the ImportedFromDecls in the lookup table (instead of calling the add-remove functions always in consistent way).

martong commented 5 years ago

Probably a better solution is to include the ImportedFromDecls in the lookup table (instead of calling the add-remove functions always in consistent way).

That is indeed a good idea, however, the lookup table is independent from the 'from' context and it holds decls only for one context. So, perhaps a higher abstraction class would be the most proper, which holds both the ImportedFromDecls and the lookuptable.