[llvm] r275646 - bugpoint: add flag -verbose-errors

Sebastian Pop via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 16:15:06 PDT 2016


Author: spop
Date: Fri Jul 15 18:15:06 2016
New Revision: 275646

URL: http://llvm.org/viewvc/llvm-project?rev=275646&view=rev
Log:
bugpoint: add flag -verbose-errors

The default behavior of bugpoint is to print "<crash>" when it finds a reduced
test that crashes compilation.  With this flag we now can see the output of the
crashing program.  This is useful to make sure it is the same error being
tracked down and not a different error that happens to crash the compiler as
well.

Differential Revision: https://reviews.llvm.org/D22411

Modified:
    llvm/trunk/docs/CommandGuide/bugpoint.rst
    llvm/trunk/tools/bugpoint/CrashDebugger.cpp

Modified: llvm/trunk/docs/CommandGuide/bugpoint.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/bugpoint.rst?rev=275646&r1=275645&r2=275646&view=diff
==============================================================================
--- llvm/trunk/docs/CommandGuide/bugpoint.rst (original)
+++ llvm/trunk/docs/CommandGuide/bugpoint.rst Fri Jul 15 18:15:06 2016
@@ -176,6 +176,14 @@ OPTIONS
  **--safe-{int,jit,llc,custom}**
  option.
 
+**--verbose-errors**\ =\ *{true,false}*
+
+ The default behavior of bugpoint is to print "<crash>" when it finds a reduced
+ test that crashes compilation. This flag prints the output of the crashing
+ program to stderr. This is useful to make sure it is the same error being
+ tracked down and not a different error that happens to crash the compiler as
+ well. Defaults to false.
+
 EXIT STATUS
 -----------
 

Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=275646&r1=275645&r2=275646&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original)
+++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Fri Jul 15 18:15:06 2016
@@ -54,6 +54,9 @@ namespace {
   cl::opt<bool> NoNamedMDRM("disable-namedmd-remove",
                             cl::desc("Do not remove global named metadata"),
                             cl::init(false));
+  cl::opt<bool> VerboseErrors("verbose-errors",
+                            cl::desc("Print the output of crashing program"),
+                            cl::init(false));
 }
 
 namespace llvm {
@@ -905,7 +908,10 @@ static bool TestForCodeGenCrash(const Bu
   std::string Error;
   BD.compileProgram(M, &Error);
   if (!Error.empty()) {
-    errs() << "<crash>\n";
+    if (VerboseErrors)
+      errs() << Error << "\n";
+    else
+      errs() << "<crash>\n";
     return true;  // Tool is still crashing.
   }
   errs() << '\n';




More information about the llvm-commits mailing list