aboutsummaryrefslogtreecommitdiffstats
path: root/src/Clazy.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Clazy.h')
-rw-r--r--src/Clazy.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/Clazy.h b/src/Clazy.h
index b80c9113..d3d0d71f 100644
--- a/src/Clazy.h
+++ b/src/Clazy.h
@@ -46,12 +46,6 @@ namespace clang {
class ClazyASTAction : public clang::PluginASTAction
{
public:
-
- enum HelpMode {
- HelpMode_Normal = 0,
- HelpMode_AnchorHeader = 1
- };
-
ClazyASTAction();
protected:
@@ -60,7 +54,7 @@ protected:
/// @note This function is reentrant
bool ParseArgs(const clang::CompilerInstance &ci, const std::vector<std::string> &args_) override;
- void PrintHelp(llvm::raw_ostream &ros, HelpMode = HelpMode_Normal) const;
+ void PrintHelp(llvm::raw_ostream &ros) const;
void PrintAnchorHeader(llvm::raw_ostream &ro, RegisteredCheck::List &checks) const;
private:
void printRequestedChecks() const;
@@ -77,11 +71,16 @@ private:
class ClazyStandaloneASTAction : public clang::ASTFrontendAction
{
public:
- explicit ClazyStandaloneASTAction(const std::string &checkList, ClazyContext::ClazyOptions = ClazyContext::ClazyOption_None);
+ explicit ClazyStandaloneASTAction(const std::string &checkList,
+ const std::string &headerFilter,
+ const std::string &ignoreDirs,
+ ClazyContext::ClazyOptions = ClazyContext::ClazyOption_None);
protected:
std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(clang::CompilerInstance &ci, llvm::StringRef) override;
private:
- std::string m_checkList;
+ const std::string m_checkList;
+ const std::string m_headerFilter;
+ const std::string m_ignoreDirs;
const ClazyContext::ClazyOptions m_options;
};
@@ -99,7 +98,7 @@ public:
bool VisitDecl(clang::Decl *decl);
bool VisitStmt(clang::Stmt *stm);
void HandleTranslationUnit(clang::ASTContext &ctx) override;
- void addCheck(CheckBase *check);
+ void addCheck(const std::pair<CheckBase *, RegisteredCheck> &check);
ClazyContext *context() const { return m_context; }
@@ -107,8 +106,12 @@ private:
ClazyASTConsumer(const ClazyASTConsumer &) = delete;
clang::Stmt *lastStm = nullptr;
ClazyContext *const m_context;
- CheckBase::List m_createdChecks;
+ //CheckBase::List m_createdChecks;
+ CheckBase::List m_checksToVisitStmts;
+ CheckBase::List m_checksToVisitDecls;
+#ifndef CLAZY_DISABLE_AST_MATCHERS
clang::ast_matchers::MatchFinder *m_matchFinder = nullptr;
+#endif
};
#endif