diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-16 02:35:01 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-16 02:35:01 +0000 |
commit | d7b8790003fb06796fb4d34284fdb5f7bed23acf (patch) | |
tree | d4eaca1bf1a485fde96bcdabffbc8c114a88ee5a /clang/tools/libclang/IndexBody.cpp | |
parent | e4acd23f0b961151a859dc59c7dc356b72f59466 (diff) | |
download | bcm5719-llvm-d7b8790003fb06796fb4d34284fdb5f7bed23acf.tar.gz bcm5719-llvm-d7b8790003fb06796fb4d34284fdb5f7bed23acf.zip |
[libclang] Indexing API: make sure we do not try to index local declarations.
llvm-svn: 144764
Diffstat (limited to 'clang/tools/libclang/IndexBody.cpp')
-rw-r--r-- | clang/tools/libclang/IndexBody.cpp | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/clang/tools/libclang/IndexBody.cpp b/clang/tools/libclang/IndexBody.cpp index 769a1c7ae81..ece1ed429ca 100644 --- a/clang/tools/libclang/IndexBody.cpp +++ b/clang/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; } |