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.

llvm-svn: 107497
This commit is contained in:
Craig Silverstein 2010-07-02 19:07:50 +00:00
parent 832282e061
commit 27e11400ad
1 changed files with 6 additions and 3 deletions

View File

@ -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));
})