[cfe-commits] r76270 - /cfe/trunk/lib/Index/ResolveLocation.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Fri Jul 17 17:33:40 PDT 2009
Author: akirtzidis
Date: Fri Jul 17 19:33:40 2009
New Revision: 76270
URL: http://llvm.org/viewvc/llvm-project?rev=76270&view=rev
Log:
Search through all Decls that are DeclContexts.
Modified:
cfe/trunk/lib/Index/ResolveLocation.cpp
Modified: cfe/trunk/lib/Index/ResolveLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/ResolveLocation.cpp?rev=76270&r1=76269&r2=76270&view=diff
==============================================================================
--- cfe/trunk/lib/Index/ResolveLocation.cpp (original)
+++ cfe/trunk/lib/Index/ResolveLocation.cpp Fri Jul 17 19:33:40 2009
@@ -93,7 +93,6 @@
ASTLocation VisitDeclContext(DeclContext *DC);
ASTLocation VisitTranslationUnitDecl(TranslationUnitDecl *TU);
- ASTLocation VisitRecordDecl(RecordDecl *D);
ASTLocation VisitVarDecl(VarDecl *D);
ASTLocation VisitFunctionDecl(FunctionDecl *D);
ASTLocation VisitDecl(Decl *D);
@@ -155,12 +154,6 @@
return ASTLoc;
}
-ASTLocation DeclLocResolver::VisitRecordDecl(RecordDecl *D) {
- assert(ContainsLocation(D) &&
- "Should visit only after verifying that loc is in range");
- return VisitDeclContext(D);
-}
-
ASTLocation DeclLocResolver::VisitFunctionDecl(FunctionDecl *D) {
assert(ContainsLocation(D) &&
"Should visit only after verifying that loc is in range");
@@ -225,6 +218,8 @@
ASTLocation DeclLocResolver::VisitDecl(Decl *D) {
assert(ContainsLocation(D) &&
"Should visit only after verifying that loc is in range");
+ if (DeclContext *DC = dyn_cast<DeclContext>(D))
+ return VisitDeclContext(DC);
return ASTLocation(D);
}
More information about the cfe-commits
mailing list