[cfe-commits] r107497 - /cfe/trunk/include/clang/AST/RecursiveASTVisitor.h

Craig Silverstein csilvers2000 at yahoo.com
Fri Jul 2 12:07:50 PDT 2010


Author: csilvers
Date: Fri Jul  2 14:07:50 2010
New Revision: 107497

URL: http://llvm.org/viewvc/llvm-project?rev=107497&view=rev
Log:
Don't visit implicitly defined functions (default constructors and the
like).  Our goal with this visitor is to visit exactly what people type.

Reviewed by chandlerc.

Modified:
    cfe/trunk/include/clang/AST/RecursiveASTVisitor.h

Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=107497&r1=107496&r2=107497&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Fri Jul  2 14:07:50 2010
@@ -386,6 +386,12 @@
   if (!D)
     return true;
 
+  // As a syntax visitor, we want to ignore declarations for
+  // implicitly-defined declarations (ones not typed explicitly by the
+  // user).
+  if (D->isImplicit())
+    return true;
+
   switch (D->getKind()) {
 #define ABSTRACT_DECL(DECL)
 #define DECL(CLASS, BASE) \
@@ -883,9 +889,6 @@
   })
 
 DEF_TRAVERSE_DECL(CXXRecordDecl, {
-    // FIXME: don't traverse compiler-generated constructor,
-    // destructor, and operator=, as they aren't written in the source
-    // code.
     TRY_TO(TraverseCXXRecordHelper(D));
   })
 





More information about the cfe-commits mailing list