diff options
Diffstat (limited to 'src/ClazyContext.cpp')
-rw-r--r-- | src/ClazyContext.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ClazyContext.cpp b/src/ClazyContext.cpp index 690609e1..4d4ecd82 100644 --- a/src/ClazyContext.cpp +++ b/src/ClazyContext.cpp @@ -49,18 +49,25 @@ public: } }; -ClazyContext::ClazyContext(const clang::CompilerInstance &compiler, ClazyOptions opts) +ClazyContext::ClazyContext(const clang::CompilerInstance &compiler, + const string &headerFilter, const string &ignoreDirs, ClazyOptions opts) : ci(compiler) , astContext(ci.getASTContext()) , sm(ci.getSourceManager()) , m_noWerror(getenv("CLAZY_NO_WERROR") != nullptr) // Allows user to make clazy ignore -Werror , options(opts) - , extraOptions(clazy_std::splitString(getenv("CLAZY_EXTRA_OPTIONS"), ',')) + , extraOptions(clazy::splitString(getenv("CLAZY_EXTRA_OPTIONS"), ',')) { + if (!headerFilter.empty()) + headerFilterRegex = std::unique_ptr<llvm::Regex>(new llvm::Regex(headerFilter)); + + if (!ignoreDirs.empty()) + ignoreDirsRegex = std::unique_ptr<llvm::Regex>(new llvm::Regex(ignoreDirs)); + const char *fixitsEnv = getenv("CLAZY_FIXIT"); allFixitsEnabled = (options & ClazyOption_AllFixitsEnabled); if (!allFixitsEnabled && fixitsEnv) { - const string fixitsEnvStr = clazy_std::unquoteString(fixitsEnv); + const string fixitsEnvStr = clazy::unquoteString(fixitsEnv); if (fixitsEnvStr == "all_fixits") { allFixitsEnabled = true; } else { |