ASTLocation VisitDeclContext(DeclContext *DC);
ASTLocation VisitTranslationUnitDecl(TranslationUnitDecl *TU);
- ASTLocation VisitRecordDecl(RecordDecl *D);
ASTLocation VisitVarDecl(VarDecl *D);
ASTLocation VisitFunctionDecl(FunctionDecl *D);
ASTLocation VisitDecl(Decl *D);
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");
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);
}