[cfe-commits] r150007 - in /cfe/trunk/tools/libclang: IndexDecl.cpp IndexingContext.cpp IndexingContext.h

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue Feb 7 14:46:16 PST 2012


Author: akirtzidis
Date: Tue Feb  7 16:46:16 2012
New Revision: 150007

URL: http://llvm.org/viewvc/llvm-project?rev=150007&view=rev
Log:
[libclang] Do not index implicit C++ member functions. rdar://10769813

Modified:
    cfe/trunk/tools/libclang/IndexDecl.cpp
    cfe/trunk/tools/libclang/IndexingContext.cpp
    cfe/trunk/tools/libclang/IndexingContext.h

Modified: cfe/trunk/tools/libclang/IndexDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexDecl.cpp?rev=150007&r1=150006&r2=150007&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/IndexDecl.cpp (original)
+++ cfe/trunk/tools/libclang/IndexDecl.cpp Tue Feb  7 16:46:16 2012
@@ -243,6 +243,9 @@
 } // 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));

Modified: cfe/trunk/tools/libclang/IndexingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexingContext.cpp?rev=150007&r1=150006&r2=150007&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/IndexingContext.cpp (original)
+++ cfe/trunk/tools/libclang/IndexingContext.cpp Tue Feb  7 16:46:16 2012
@@ -1012,7 +1012,7 @@
   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))

Modified: cfe/trunk/tools/libclang/IndexingContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexingContext.h?rev=150007&r1=150006&r2=150007&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/IndexingContext.h (original)
+++ cfe/trunk/tools/libclang/IndexingContext.h Tue Feb  7 16:46:16 2012
@@ -459,7 +459,7 @@
 
   CXCursor getRefCursor(const NamedDecl *D, SourceLocation Loc);
 
-  static bool shouldIgnoreIfImplicit(const NamedDecl *D);
+  static bool shouldIgnoreIfImplicit(const Decl *D);
 };
 
 class ScratchAlloc {





More information about the cfe-commits mailing list