@@ -166,6 +166,29 @@ class AnalyzerOptions : public RefCountedBase<AnalyzerOptions> {
166
166
static std::vector<StringRef>
167
167
getRegisteredCheckers (bool IncludeExperimental = false );
168
168
169
+ // / Convenience function for printing options or checkers and their
170
+ // / description in a formatted manner. If \p MinLineWidth is set to 0, no line
171
+ // / breaks are introduced for the description.
172
+ // /
173
+ // / Format, depending whether the option name's length is less then
174
+ // / \p OptionWidth:
175
+ // /
176
+ // / <padding>EntryName<padding>Description
177
+ // / <---------padding--------->Description
178
+ // / <---------padding--------->Description
179
+ // /
180
+ // / <padding>VeryVeryLongOptionName
181
+ // / <---------padding--------->Description
182
+ // / <---------padding--------->Description
183
+ // / ^~~~~~~~ InitialPad
184
+ // / ^~~~~~~~~~~~~~~~~~~~~~~~~~ EntryWidth
185
+ // / ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~MinLineWidth
186
+ static void printFormattedEntry (
187
+ llvm::raw_ostream &Out,
188
+ std::pair<StringRef, StringRef> EntryDescPair,
189
+ size_t EntryWidth, size_t InitialPad, size_t MinLineWidth = 0 );
190
+
191
+
169
192
// / Pair of checker name and enable/disable.
170
193
std::vector<std::pair<std::string, bool >> CheckersControlList;
171
194
@@ -199,6 +222,7 @@ class AnalyzerOptions : public RefCountedBase<AnalyzerOptions> {
199
222
unsigned ShowCheckerHelp : 1 ;
200
223
unsigned ShowCheckerHelpHidden : 1 ;
201
224
unsigned ShowEnabledCheckerList : 1 ;
225
+ unsigned ShowCheckerOptionList : 1 ;
202
226
unsigned ShowConfigOptionsList : 1 ;
203
227
unsigned ShouldEmitErrorsOnInvalidConfigValue : 1 ;
204
228
unsigned AnalyzeAll : 1 ;
@@ -262,11 +286,11 @@ class AnalyzerOptions : public RefCountedBase<AnalyzerOptions> {
262
286
AnalyzerOptions ()
263
287
: DisableAllChecks(false ), ShowCheckerHelp(false ),
264
288
ShowCheckerHelpHidden (false ), ShowEnabledCheckerList(false ),
265
- ShowConfigOptionsList (false ), AnalyzeAll (false ),
266
- AnalyzerDisplayProgress (false ), AnalyzeNestedBlocks (false ),
267
- eagerlyAssumeBinOpBifurcation (false ), TrimGraph (false ),
268
- visualizeExplodedGraphWithGraphViz (false ), UnoptimizedCFG (false ),
269
- PrintStats(false ), NoRetryExhausted(false ) {
289
+ ShowCheckerOptionList (false ), ShowConfigOptionsList (false ),
290
+ AnalyzeAll (false ), AnalyzerDisplayProgress (false ),
291
+ AnalyzeNestedBlocks (false ), eagerlyAssumeBinOpBifurcation (false ),
292
+ TrimGraph (false ), visualizeExplodedGraphWithGraphViz (false ),
293
+ UnoptimizedCFG( false ), PrintStats(false ), NoRetryExhausted(false ) {
270
294
llvm::sort (AnalyzerConfigCmdFlags);
271
295
}
272
296
0 commit comments