From d080f935ce18612f028f65f6bd7c6632ded46729 Mon Sep 17 00:00:00 2001 From: Kristof Umann Date: Sat, 26 Jan 2019 15:59:21 +0000 Subject: [analyzer][NFC] Supply CheckerRegistry with AnalyzerOptions Since pretty much all methods of CheckerRegistry has AnalyzerOptions as an argument, it makes sense to just simply require it in it's constructor. Differential Revision: https://reviews.llvm.org/D56988 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352279 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h | 12 ++++++------ include/clang/StaticAnalyzer/Frontend/FrontendActions.h | 9 ++++++--- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h b/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h index a30e3a7a18..f394ed911b 100644 --- a/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h +++ b/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h @@ -82,7 +82,7 @@ namespace ento { class CheckerRegistry { public: CheckerRegistry(ArrayRef plugins, DiagnosticsEngine &diags, - const LangOptions &LangOpts); + AnalyzerOptions &AnOpts, const LangOptions &LangOpts); /// Initialization functions perform any necessary setup for a checker. /// They should include a call to CheckerManager::registerChecker. @@ -137,24 +137,24 @@ public: /// all checkers specified by the given CheckerOptInfo list. The order of this /// list is significant; later options can be used to reverse earlier ones. /// This can be used to exclude certain checkers in an included package. - void initializeManager(CheckerManager &mgr, - const AnalyzerOptions &Opts) const; + void initializeManager(CheckerManager &mgr) const; /// Check if every option corresponds to a specific checker or package. - void validateCheckerOptions(const AnalyzerOptions &opts) const; + void validateCheckerOptions() const; /// Prints the name and description of all checkers in this registry. /// This output is not intended to be machine-parseable. void printHelp(raw_ostream &out, size_t maxNameChars = 30) const; - void printList(raw_ostream &out, const AnalyzerOptions &opts) const; + void printList(raw_ostream &out) const; private: - CheckerInfoSet getEnabledCheckers(const AnalyzerOptions &Opts) const; + CheckerInfoSet getEnabledCheckers() const; mutable CheckerInfoList Checkers; mutable llvm::StringMap Packages; DiagnosticsEngine &Diags; + AnalyzerOptions &AnOpts; const LangOptions &LangOpts; }; diff --git a/include/clang/StaticAnalyzer/Frontend/FrontendActions.h b/include/clang/StaticAnalyzer/Frontend/FrontendActions.h index f8bd24df2b..5f26a4893c 100644 --- a/include/clang/StaticAnalyzer/Frontend/FrontendActions.h +++ b/include/clang/StaticAnalyzer/Frontend/FrontendActions.h @@ -51,10 +51,13 @@ private: llvm::StringMap &Bodies; }; -void printCheckerHelp(raw_ostream &OS, ArrayRef plugins, - DiagnosticsEngine &diags, const LangOptions &LangOpts); +void printCheckerHelp(raw_ostream &OS, + ArrayRef plugins, + AnalyzerOptions &opts, + DiagnosticsEngine &diags, + const LangOptions &LangOpts); void printEnabledCheckerList(raw_ostream &OS, ArrayRef plugins, - const AnalyzerOptions &opts, + AnalyzerOptions &opts, DiagnosticsEngine &diags, const LangOptions &LangOpts); void printAnalyzerConfigList(raw_ostream &OS); -- cgit v1.2.1