aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/IndexBody.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libclang/IndexBody.cpp')
-rw-r--r--tools/libclang/IndexBody.cpp25
1 files changed, 4 insertions, 21 deletions
diff --git a/tools/libclang/IndexBody.cpp b/tools/libclang/IndexBody.cpp
index 769a1c7ae8..ece1ed429c 100644
--- a/tools/libclang/IndexBody.cpp
+++ b/tools/libclang/IndexBody.cpp
@@ -32,35 +32,18 @@ public:
}
bool VisitDeclRefExpr(DeclRefExpr *E) {
- const NamedDecl *D = E->getDecl();
- if (!D)
- return true;
- if (D->getParentFunctionOrMethod())
- return true;
-
- IndexCtx.handleReference(D, E->getLocation(), 0, ParentDC, E);
+ IndexCtx.handleReference(E->getDecl(), E->getLocation(), 0, ParentDC, E);
return true;
}
bool VisitMemberExpr(MemberExpr *E) {
- const NamedDecl *D = E->getMemberDecl();
- if (!D)
- return true;
- if (D->getParentFunctionOrMethod())
- return true;
-
- IndexCtx.handleReference(D, E->getMemberLoc(), 0, ParentDC, E);
+ IndexCtx.handleReference(E->getMemberDecl(), E->getMemberLoc(), 0, ParentDC,
+ E);
return true;
}
bool VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
- const NamedDecl *D = E->getDecl();
- if (!D)
- return true;
- if (D->getParentFunctionOrMethod())
- return true;
-
- IndexCtx.handleReference(D, E->getLocation(), 0, ParentDC, E);
+ IndexCtx.handleReference(E->getDecl(), E->getLocation(), 0, ParentDC, E);
return true;
}