diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-21 00:07:06 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-21 00:07:06 +0000 |
commit | 05ac8276cfc37ac89bb46551e1aa7617295ab341 (patch) | |
tree | 52b23e8ce8cd01437a93042cbd02baf559e01a80 /clang/tools/index-test/index-test.cpp | |
parent | ed73cac647942fb08c052d466e054027a7790d63 (diff) | |
download | bcm5719-llvm-05ac8276cfc37ac89bb46551e1aa7617295ab341.tar.gz bcm5719-llvm-05ac8276cfc37ac89bb46551e1aa7617295ab341.zip |
Change the semantics for Entity.
Entity can now refer to declarations that are not visible outside the translation unit.
It is a wrapper of a pointer union, it's either a Decl* for declarations that don't
"cross" translation units, or an EntityImpl* which is associated with the specific "visible" Decl.
Included is a test case for handling fields across translation units.
llvm-svn: 76515
Diffstat (limited to 'clang/tools/index-test/index-test.cpp')
-rw-r--r-- | clang/tools/index-test/index-test.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/tools/index-test/index-test.cpp b/clang/tools/index-test/index-test.cpp index 8fd871d08cb..4516e31365b 100644 --- a/clang/tools/index-test/index-test.cpp +++ b/clang/tools/index-test/index-test.cpp @@ -151,10 +151,8 @@ static void ProcessASTLocation(ASTLocation ASTLoc, IndexProvider &IdxProvider) { return; } - Entity *Ent = Entity::get(D, IdxProvider.getProgram()); - // If there is no Entity associated with this Decl, it means that it's not - // visible to other translation units. - if (!Ent) + Entity Ent = Entity::get(D, IdxProvider.getProgram()); + if (Ent.isInvalid() || Ent.isInternalToTU()) return ProcessDecl(D); // Find the "same" Decl in other translation units and print information. @@ -162,7 +160,7 @@ static void ProcessASTLocation(ASTLocation ASTLoc, IndexProvider &IdxProvider) { I = IdxProvider.translation_units_begin(Ent), E = IdxProvider.translation_units_end(Ent); I != E; ++I) { TUnit *TU = static_cast<TUnit*>(*I); - Decl *OtherD = Ent->getDecl(TU->getASTContext()); + Decl *OtherD = Ent.getDecl(TU->getASTContext()); assert(OtherD && "Couldn't resolve Entity"); ProcessDecl(OtherD); } |