]> granicus.if.org Git - clang/commitdiff
[libclang] Do not index implicit C++ member functions. rdar://10769813
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 7 Feb 2012 22:46:16 +0000 (22:46 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 7 Feb 2012 22:46:16 +0000 (22:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150007 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/IndexDecl.cpp
tools/libclang/IndexingContext.cpp
tools/libclang/IndexingContext.h

index c6080df5928f523548623dfdbb3bb84103473e8e..d2eb402ba2801e701bd5482e4763ac9c49b4a8f4 100644 (file)
@@ -243,6 +243,9 @@ public:
 } // anonymous namespace
 
 void IndexingContext::indexDecl(const Decl *D) {
+  if (D->isImplicit() && shouldIgnoreIfImplicit(D))
+    return;
+
   bool Handled = IndexingDeclVisitor(*this).Visit(const_cast<Decl*>(D));
   if (!Handled && isa<DeclContext>(D))
     indexDeclContext(cast<DeclContext>(D));
index 32eb326abbbae461ec78d8d8eda116764fafd993..2e69c46849488f975bdd01c48d20e3704a7120ad 100644 (file)
@@ -1012,7 +1012,7 @@ CXCursor IndexingContext::getRefCursor(const NamedDecl *D, SourceLocation Loc) {
   return clang_getNullCursor();
 }
 
-bool IndexingContext::shouldIgnoreIfImplicit(const NamedDecl *D) {
+bool IndexingContext::shouldIgnoreIfImplicit(const Decl *D) {
   if (isa<ObjCInterfaceDecl>(D))
     return false;
   if (isa<ObjCCategoryDecl>(D))
index bc33005e89dde3eb9218f37daa665fb1052e5757..ef8e24e7c34a9e1bc18cbe3de82b754634472940 100644 (file)
@@ -459,7 +459,7 @@ private:
 
   CXCursor getRefCursor(const NamedDecl *D, SourceLocation Loc);
 
-  static bool shouldIgnoreIfImplicit(const NamedDecl *D);
+  static bool shouldIgnoreIfImplicit(const Decl *D);
 };
 
 class ScratchAlloc {