Major redesign of the RecursiveASTVisitor. This implements the majority of the
new design discussed on cfe-dev, with further steps in that direction to come.
It is already much more complete than the previous visitor.
Patch by Zhanyong and Craig with 80 column wraps and one missing declaration
added by me.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105709 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/BoostConAction.cpp b/lib/Frontend/BoostConAction.cpp
index ae150c6..799ec92 100644
--- a/lib/Frontend/BoostConAction.cpp
+++ b/lib/Frontend/BoostConAction.cpp
@@ -14,17 +14,17 @@
using namespace clang;
namespace {
- class BoostConASTConsumer : public ASTConsumer,
+ class BoostConASTConsumer : public ASTConsumer,
public RecursiveASTVisitor<BoostConASTConsumer> {
public:
/// HandleTranslationUnit - This method is called when the ASTs for entire
/// translation unit have been parsed.
virtual void HandleTranslationUnit(ASTContext &Ctx);
-
+
bool VisitCXXRecordDecl(CXXRecordDecl *D) {
std::cout << D->getNameAsString() << std::endl;
return false;
- }
+ }
};
}
@@ -35,5 +35,5 @@
void BoostConASTConsumer::HandleTranslationUnit(ASTContext &Ctx) {
fprintf(stderr, "Welcome to BoostCon!\n");
- Visit(Ctx.getTranslationUnitDecl());
+ TraverseDecl(Ctx.getTranslationUnitDecl());
}