diff --git a/lib/Interpreter/AutoloadingTransform.cpp b/lib/Interpreter/AutoloadingTransform.cpp index 994fb7ed..09fc4e7a 100644 --- a/lib/Interpreter/AutoloadingTransform.cpp +++ b/lib/Interpreter/AutoloadingTransform.cpp @@ -2,7 +2,7 @@ #include "clang/Lex/Preprocessor.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/AST/AST.h" -#include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/DeclVisitor.h" #include "AutoloadingTransform.h" #include "cling/Interpreter/Transaction.h" @@ -11,16 +11,10 @@ using namespace clang; namespace cling { - AutoloadingTransform::AutoloadingTransform(clang::Sema* S, Interpreter*) - : TransactionTransformer(S) { - } - AutoloadingTransform::~AutoloadingTransform() - {} - - class DeclVisitor : public RecursiveASTVisitor { + class DeclFixer : public DeclVisitor { public: - bool TraverseEnumDecl(EnumDecl* ED) { + void VisitEnumDecl(EnumDecl* ED) { if (ED->isFixed()) { StringRef str = ED->getAttr()->getAnnotation(); char ch = str.back(); @@ -35,13 +29,12 @@ namespace cling { if (ch != '1') EnumDeclDerived::setFixed(ED, false); } - return true; } }; void AutoloadingTransform::Transform() { const Transaction* T = getTransaction(); - DeclVisitor visitor; + DeclFixer visitor; for (Transaction::const_iterator I = T->decls_begin(), E = T->decls_end(); I != E; ++I) { Transaction::DelayCallInfo DCI = *I; @@ -49,7 +42,7 @@ namespace cling { JE = DCI.m_DGR.end(); J != JE; ++J) { if (!(*J)->hasAttr()) continue; - visitor.TraverseDecl(*J); + visitor.Visit(*J); //FIXME: Enable when safe ! // if ( (*J)->hasAttr() /*FIXME: && CorrectCallbackLoaded() how ? */ ) // clang::Decl::castToDeclContext(*J)->setHasExternalLexicalStorage();