21#include "llvm/ADT/SmallVector.h"
22#include "llvm/Support/raw_ostream.h"
29 out <<
"OVERVIEW: Clang Static Analyzer Checkers List\n\n";
30 out <<
"USAGE: -analyzer-checker <CHECKER or PACKAGE,...>\n\n";
32 auto CheckerMgr = std::make_unique<CheckerManager>(
36 CheckerMgr->getCheckerRegistryData().printCheckerWithDescList(
41 out <<
"OVERVIEW: Clang Static Analyzer Enabled Checkers List\n\n";
43 auto CheckerMgr = std::make_unique<CheckerManager>(
47 CheckerMgr->getCheckerRegistryData().printEnabledCheckerList(out);
52 auto CheckerMgr = std::make_unique<CheckerManager>(
56 CheckerMgr->getCheckerRegistryData().printCheckerOptionList(
66OVERVIEW: Clang Static Analyzer -analyzer-config Option List
68The following list of configurations are meant for development purposes only, as
69some of the variables they define are set to result in the most optimal
70analysis. Setting them to other values may drastically change how the analyzer
71behaves, and may even result in instabilities, crashes!
73USAGE: -analyzer-config <OPTION1=VALUE,OPTION2=VALUE,...>
74 -analyzer-config OPTION1=VALUE, -analyzer-config OPTION2=VALUE, ...
78 using OptionAndDescriptionTy = std::pair<StringRef, std::string>;
79 OptionAndDescriptionTy PrintableOptions[] = {
80#define ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, DEFAULT_VAL) \
83 llvm::Twine(llvm::Twine() + "(" + \
84 (StringRef(#TYPE) == "StringRef" ? "string" : #TYPE ) + \
86 " (default: " #DEFAULT_VAL ")").str() \
89#define ANALYZER_OPTION_DEPENDS_ON_USER_MODE(TYPE, NAME, CMDFLAG, DESC, \
90 SHALLOW_VAL, DEEP_VAL) \
93 llvm::Twine(llvm::Twine() + "(" + \
94 (StringRef(#TYPE) == "StringRef" ? "string" : #TYPE ) + \
96 " (default: " #SHALLOW_VAL " in shallow mode, " #DEEP_VAL \
97 " in deep mode)").str() \
99#include "clang/StaticAnalyzer/Core/AnalyzerOptions.def"
100#undef ANALYZER_OPTION
101#undef ANALYZER_OPTION_DEPENDS_ON_USER_MODE
104 llvm::sort(PrintableOptions, llvm::less_first());
106 for (
const auto &Pair : PrintableOptions) {
Defines the Diagnostic-related interfaces.
static void printFormattedEntry(llvm::raw_ostream &Out, std::pair< StringRef, StringRef > EntryDescPair, size_t InitialPad, size_t EntryWidth, size_t MinLineWidth=0)
Convenience function for printing options or checkers and their description in a formatted manner.
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
AnalyzerOptions & getAnalyzerOpts()
DiagnosticsEngine & getDiagnostics() const
Get the current diagnostics engine.
FrontendOptions & getFrontendOpts()
LangOptions & getLangOpts()
std::vector< std::string > Plugins
The list of plugins to load.
void printEnabledCheckerList(llvm::raw_ostream &OS, CompilerInstance &CI)
void printCheckerHelp(llvm::raw_ostream &OS, CompilerInstance &CI)
void printAnalyzerConfigList(llvm::raw_ostream &OS)
void printCheckerConfigList(llvm::raw_ostream &OS, CompilerInstance &CI)
The JSON file list parser is used to communicate input to InstallAPI.