[cfe-commits] r74802 - in /cfe/trunk: include/clang/Index/ include/clang/Index/Entity.h include/clang/Index/EntityHandler.h include/clang/Index/IndexProvider.h include/clang/Index/Program.h include/clang/Index/TranslationUnit.h lib/CMakeLists.txt lib/Index/ lib/Index/CMakeLists.txt lib/Index/Entity.cpp lib/Index/IndexProvider.cpp lib/Index/Makefile lib/Index/Program.cpp lib/Index/ProgramImpl.h lib/Makefile

Chris Lattner clattner at apple.com
Sun Jul 12 15:35:42 PDT 2009


On Jul 5, 2009, at 3:22 PM, Argiris Kirtzidis wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=74802&view=rev
> Log:
> Introduce the 'Index' library.
>
> Its purpose is to provide the basic infrastructure for cross- 
> translation-unit analysis like indexing, refactoring, etc.
>
> Currently it is very "primitive" and with no type-names support. It  
> can provide functionality like
> "show me all references of this function from these translation  
> units".

Hey Argiris,

This looks like great work, one minor comment below:

> +class Entity : public llvm::FoldingSetNode {
> +public:

Why should Entity's be FoldingSetNodes?  There are two reasons to use  
a folding set (instead of a DenseMap<pair<Entity*,void*>, Entity*>):

1. If you want to derive from Entity, so you may have heterogenous  
keys indexing the map.
2. If the key data is large.

I don't think either of these applies here, should Entity's be uniqued  
with a DenseMap instead of a FoldingSet?

-Chris




More information about the cfe-commits mailing list