<div dir="ltr"><div dir="ltr">Also one of your resent commits added another broken test to the builder:<br><a href="http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/13729">http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/13729</a><br>. . .<br>Failing Tests:<br>. . . <br> Clang-Unit :: Frontend/./FrontendTests.exe/FrontendOutputTests.TestOutputStream<br>. . .<br><br>The builder did not send notifications on this.<br>Please have a look?<br><br>Thanks<br><br>Galina<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 2, 2018 at 9:01 AM Kristof Umann via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: szelethus<br>
Date: Fri Nov 2 08:59:37 2018<br>
New Revision: 345989<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=345989&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=345989&view=rev</a><br>
Log:<br>
[analyzer] New flag to print all -analyzer-config options<br>
<br>
A new -cc1 flag is avaible for the said purpose: -analyzer-config-help<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D53296" rel="noreferrer" target="_blank">https://reviews.llvm.org/D53296</a><br>
<br>
Added:<br>
cfe/trunk/test/Analysis/analyzer-list-configs.c<br>
Modified:<br>
cfe/trunk/include/clang/Driver/CC1Options.td<br>
cfe/trunk/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h<br>
cfe/trunk/include/clang/StaticAnalyzer/Frontend/FrontendActions.h<br>
cfe/trunk/lib/Frontend/CompilerInvocation.cpp<br>
cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp<br>
cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Driver/CC1Options.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=345989&r1=345988&r2=345989&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=345989&r1=345988&r2=345989&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)<br>
+++ cfe/trunk/include/clang/Driver/CC1Options.td Fri Nov 2 08:59:37 2018<br>
@@ -129,6 +129,9 @@ def analyzer_disable_all_checks : Flag<[<br>
def analyzer_checker_help : Flag<["-"], "analyzer-checker-help">,<br>
HelpText<"Display the list of analyzer checkers that are available">;<br>
<br>
+def analyzer_config_help : Flag<["-"], "analyzer-config-help">,<br>
+ HelpText<"Display the list of -analyzer-config options">;<br>
+<br>
def analyzer_list_enabled_checkers : Flag<["-"], "analyzer-list-enabled-checkers">,<br>
HelpText<"Display the list of enabled analyzer checkers">;<br>
<br>
<br>
Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h?rev=345989&r1=345988&r2=345989&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h?rev=345989&r1=345988&r2=345989&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h (original)<br>
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h Fri Nov 2 08:59:37 2018<br>
@@ -175,6 +175,7 @@ public:<br>
<br>
unsigned ShowCheckerHelp : 1;<br>
unsigned ShowEnabledCheckerList : 1;<br>
+ unsigned ShowConfigOptionsList : 1;<br>
unsigned AnalyzeAll : 1;<br>
unsigned AnalyzerDisplayProgress : 1;<br>
unsigned AnalyzeNestedBlocks : 1;<br>
<br>
Modified: cfe/trunk/include/clang/StaticAnalyzer/Frontend/FrontendActions.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Frontend/FrontendActions.h?rev=345989&r1=345988&r2=345989&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Frontend/FrontendActions.h?rev=345989&r1=345988&r2=345989&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/StaticAnalyzer/Frontend/FrontendActions.h (original)<br>
+++ cfe/trunk/include/clang/StaticAnalyzer/Frontend/FrontendActions.h Fri Nov 2 08:59:37 2018<br>
@@ -55,6 +55,7 @@ private:<br>
void printCheckerHelp(raw_ostream &OS, ArrayRef<std::string> plugins);<br>
void printEnabledCheckerList(raw_ostream &OS, ArrayRef<std::string> plugins,<br>
const AnalyzerOptions &opts);<br>
+void printAnalyzerConfigList(raw_ostream &OS);<br>
<br>
} // end GR namespace<br>
<br>
<br>
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=345989&r1=345988&r2=345989&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=345989&r1=345988&r2=345989&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)<br>
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Fri Nov 2 08:59:37 2018<br>
@@ -279,6 +279,7 @@ static bool ParseAnalyzerArgs(AnalyzerOp<br>
}<br>
<br>
Opts.ShowCheckerHelp = Args.hasArg(OPT_analyzer_checker_help);<br>
+ Opts.ShowConfigOptionsList = Args.hasArg(OPT_analyzer_config_help);<br>
Opts.ShowEnabledCheckerList = Args.hasArg(OPT_analyzer_list_enabled_checkers);<br>
Opts.DisableAllChecks = Args.hasArg(OPT_analyzer_disable_all_checks);<br>
<br>
<br>
Modified: cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp?rev=345989&r1=345988&r2=345989&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp?rev=345989&r1=345988&r2=345989&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp (original)<br>
+++ cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp Fri Nov 2 08:59:37 2018<br>
@@ -241,11 +241,19 @@ bool ExecuteCompilerInvocation(CompilerI<br>
ento::printCheckerHelp(llvm::outs(), Clang->getFrontendOpts().Plugins);<br>
return true;<br>
}<br>
+<br>
+ // Honor -analyzer-list-enabled-checkers.<br>
if (Clang->getAnalyzerOpts()->ShowEnabledCheckerList) {<br>
ento::printEnabledCheckerList(llvm::outs(),<br>
Clang->getFrontendOpts().Plugins,<br>
*Clang->getAnalyzerOpts());<br>
}<br>
+<br>
+ // Honor -analyzer-config-help.<br>
+ if (Clang->getAnalyzerOpts()->ShowConfigOptionsList) {<br>
+ ento::printAnalyzerConfigList(llvm::outs());<br>
+ return true;<br>
+ }<br>
#endif<br>
<br>
// If there were errors in processing arguments, don't do anything else.<br>
<br>
Modified: cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp?rev=345989&r1=345988&r2=345989&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp?rev=345989&r1=345988&r2=345989&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp (original)<br>
+++ cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp Fri Nov 2 08:59:37 2018<br>
@@ -22,6 +22,7 @@<br>
#include "clang/StaticAnalyzer/Frontend/FrontendActions.h"<br>
#include "llvm/ADT/SmallVector.h"<br>
#include "llvm/Support/DynamicLibrary.h"<br>
+#include "llvm/Support/FormattedStream.h"<br>
#include "llvm/Support/Path.h"<br>
#include "llvm/Support/raw_ostream.h"<br>
#include <memory><br>
@@ -157,3 +158,74 @@ void ento::printEnabledCheckerList(raw_o<br>
SmallVector<CheckerOptInfo, 8> checkerOpts = getCheckerOptList(opts);<br>
ClangCheckerRegistry(plugins).printList(out, checkerOpts);<br>
}<br>
+<br>
+void ento::printAnalyzerConfigList(raw_ostream &out) {<br>
+ out << "OVERVIEW: Clang Static Analyzer -analyzer-config Option List\n\n";<br>
+ out << "USAGE: clang -cc1 [CLANG_OPTIONS] -analyzer-config "<br>
+ "<OPTION1=VALUE,OPTION2=VALUE,...>\n\n";<br>
+ out << " clang -cc1 [CLANG_OPTIONS] -analyzer-config OPTION1=VALUE, "<br>
+ "-analyzer-config OPTION2=VALUE, ...\n\n";<br>
+ out << " clang [CLANG_OPTIONS] -Xclang -analyzer-config -Xclang"<br>
+ "<OPTION1=VALUE,OPTION2=VALUE,...>\n\n";<br>
+ out << " clang [CLANG_OPTIONS] -Xclang -analyzer-config -Xclang "<br>
+ "OPTION1=VALUE, -Xclang -analyzer-config -Xclang "<br>
+ "OPTION2=VALUE, ...\n\n";<br>
+ out << "OPTIONS:\n\n";<br>
+<br>
+ using OptionAndDescriptionTy = std::pair<StringRef, std::string>;<br>
+ OptionAndDescriptionTy PrintableOptions[] = {<br>
+#define ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, DEFAULT_VAL) \<br>
+ { \<br>
+ CMDFLAG, \<br>
+ llvm::Twine(llvm::Twine() + "(" + \<br>
+ (#TYPE == "StringRef" ? "string" : #TYPE ) + ") " DESC \<br>
+ " (default: " #DEFAULT_VAL ")").str() \<br>
+ },<br>
+<br>
+#define ANALYZER_OPTION_DEPENDS_ON_USER_MODE(TYPE, NAME, CMDFLAG, DESC, \<br>
+ SHALLOW_VAL, DEEP_VAL) \<br>
+ { \<br>
+ CMDFLAG, \<br>
+ llvm::Twine(llvm::Twine() + "(" + \<br>
+ (#TYPE == "StringRef" ? "string" : #TYPE ) + ") " DESC \<br>
+ " (default: " #SHALLOW_VAL " in shallow mode, " #DEEP_VAL \<br>
+ " in deep mode)").str() \<br>
+ },<br>
+#include "clang/StaticAnalyzer/Core/AnalyzerOptions.def"<br>
+#undef ANALYZER_OPTION<br>
+#undef ANALYZER_OPTION_DEPENDS_ON_USER_MODE<br>
+ };<br>
+<br>
+ llvm::sort(PrintableOptions, [](const OptionAndDescriptionTy &LHS,<br>
+ const OptionAndDescriptionTy &RHS) {<br>
+ return LHS.first < RHS.first;<br>
+ });<br>
+<br>
+ constexpr size_t MinLineWidth = 70;<br>
+ constexpr size_t PadForOpt = 2;<br>
+ constexpr size_t OptionWidth = 30;<br>
+ constexpr size_t PadForDesc = PadForOpt + OptionWidth;<br>
+ static_assert(MinLineWidth > PadForDesc, "MinLineWidth must be greater!");<br>
+<br>
+ llvm::formatted_raw_ostream FOut(out);<br>
+<br>
+ for (const auto &Pair : PrintableOptions) {<br>
+ FOut.PadToColumn(PadForOpt) << Pair.first;<br>
+<br>
+ // If the buffer's length is greater then PadForDesc, print a newline.<br>
+ if (FOut.getColumn() > PadForDesc)<br>
+ FOut << '\n';<br>
+<br>
+ FOut.PadToColumn(PadForDesc);<br>
+<br>
+ for (char C : Pair.second) {<br>
+ if (FOut.getColumn() > MinLineWidth && C == ' ') {<br>
+ FOut << '\n';<br>
+ FOut.PadToColumn(PadForDesc);<br>
+ continue;<br>
+ }<br>
+ FOut << C;<br>
+ }<br>
+ FOut << "\n\n";<br>
+ }<br>
+}<br>
<br>
Added: cfe/trunk/test/Analysis/analyzer-list-configs.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/analyzer-list-configs.c?rev=345989&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/analyzer-list-configs.c?rev=345989&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Analysis/analyzer-list-configs.c (added)<br>
+++ cfe/trunk/test/Analysis/analyzer-list-configs.c Fri Nov 2 08:59:37 2018<br>
@@ -0,0 +1,33 @@<br>
+// RUN: %clang_cc1 -analyzer-config-help 2>&1 | FileCheck %s<br>
+// CHECK: OVERVIEW: Clang Static Analyzer -analyzer-config Option List<br>
+//<br>
+// CHECK: USAGE: clang -cc1 [CLANG_OPTIONS] -analyzer-config <OPTION1=VALUE,OPTION2=VALUE,...><br>
+//<br>
+// CHCEK: clang -cc1 [CLANG_OPTIONS] -analyzer-config OPTION1=VALUE, -analyzer-config OPTION2=VALUE, ...<br>
+//<br>
+// CHECK: clang [CLANG_OPTIONS] -Xclang -analyzer-config -Xclang<OPTION1=VALUE,OPTION2=VALUE,...><br>
+//<br>
+// CHECK: clang [CLANG_OPTIONS] -Xclang -analyzer-config -Xclang OPTION1=VALUE, -Xclang -analyzer-config -Xclang OPTION2=VALUE, ...<br>
+//<br>
+//<br>
+// CHECK: OPTIONS:<br>
+//<br>
+// CHECK: aggressive-binary-operation-simplification<br>
+// CHECK: (bool) Whether SValBuilder should rearrange<br>
+// CHECK: comparisons and additive operations of symbolic<br>
+// CHECK: expressions which consist of a sum of a<br>
+// CHECK: symbol and a concrete integer into the format<br>
+// CHECK: where symbols are on the left-hand side<br>
+// CHECK: and the integer is on the right. This is<br>
+// CHECK: only done if both symbols and both concrete<br>
+// CHECK: integers are signed, greater than or equal<br>
+// CHECK: to the quarter of the minimum value of the<br>
+// CHECK: type and less than or equal to the quarter<br>
+// CHECK: of the maximum value of that type. A + n<br>
+// CHECK: <OP> B + m becomes A - B <OP> m - n, where<br>
+// CHECK: A and B symbolic, n and m are integers.<br>
+// CHECK: <OP> is any of '==', '!=', '<', '<=', '>',<br>
+// CHECK: '>=', '+' or '-'. The rearrangement also<br>
+// CHECK: happens with '-' instead of '+' on either<br>
+// CHECK: or both side and also if any or both integers<br>
+// CHECK: are missing. (default: false)<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>