21 #include "llvm/ADT/SmallVector.h"
22 #include "llvm/Support/raw_ostream.h"
25 using namespace clang;
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(
66 OVERVIEW: Clang Static Analyzer -analyzer-config Option List
68 The following list of configurations are meant for development purposes only, as
69 some of the variables they define are set to result in the most optimal
70 analysis. Setting them to other values may drastically change how the analyzer
71 behaves, and may even result in instabilities, crashes!
73 USAGE: -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, [](
const OptionAndDescriptionTy &LHS,
105 const OptionAndDescriptionTy &RHS) {
106 return LHS.first < RHS.first;
109 for (
const auto &Pair : PrintableOptions) {