diff options
author | Craig Silverstein <csilvers2000@yahoo.com> | 2010-07-02 19:07:50 +0000 |
---|---|---|
committer | Craig Silverstein <csilvers2000@yahoo.com> | 2010-07-02 19:07:50 +0000 |
commit | d0b982ca5cf685af08d5015e8c2dfae3ecab1a0b (patch) | |
tree | 7ab94bee0732a0d3ef9e2cc7d57f54a9d19261b7 | |
parent | 23c94dbb6631fecdb55ba401aa93722803d980c6 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107497 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/RecursiveASTVisitor.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index d593be81f9..e0a2a015d4 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -386,6 +386,12 @@ bool RecursiveASTVisitor<Derived>::TraverseDecl(Decl *D) { 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(RecordDecl, { }) 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)); }) |