aboutsummaryrefslogtreecommitdiffstats
path: root/src/Clazy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Clazy.cpp')
-rw-r--r--src/Clazy.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Clazy.cpp b/src/Clazy.cpp
index 037316f9..5ef48ae0 100644
--- a/src/Clazy.cpp
+++ b/src/Clazy.cpp
@@ -62,17 +62,20 @@ static void manuallyPopulateParentMap(ParentMap *map, Stmt *s)
ClazyASTConsumer::ClazyASTConsumer(ClazyContext *context)
: m_context(context)
{
+ clang::ast_matchers::MatchFinder::MatchFinderOptions options;
+ m_matchFinder = new clang::ast_matchers::MatchFinder(options);
}
void ClazyASTConsumer::addCheck(CheckBase *check)
{
- check->registerASTMatchers(m_matchFinder);
+ check->registerASTMatchers(*m_matchFinder);
m_createdChecks.push_back(check);
}
ClazyASTConsumer::~ClazyASTConsumer()
{
delete m_context;
+ delete m_matchFinder;
}
bool ClazyASTConsumer::VisitDecl(Decl *decl)
@@ -132,7 +135,7 @@ void ClazyASTConsumer::HandleTranslationUnit(ASTContext &ctx)
TraverseDecl(ctx.getTranslationUnitDecl());
// Run our AstMatcher base checks:
- m_matchFinder.matchAST(ctx);
+ m_matchFinder->matchAST(ctx);
}
static bool parseArgument(const string &arg, vector<string> &args)