[PATCH] D22411: bugpoint: add flag -verbose-errors

Sebastian Pop via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 14:32:24 PDT 2016


sebpop updated this revision to Diff 64196.
sebpop added a comment.

Added documentation.  If there are no other comments I will push the change later today.


https://reviews.llvm.org/D22411

Files:
  llvm/docs/CommandGuide/bugpoint.rst
  llvm/tools/bugpoint/CrashDebugger.cpp

Index: llvm/tools/bugpoint/CrashDebugger.cpp
===================================================================
--- llvm/tools/bugpoint/CrashDebugger.cpp
+++ llvm/tools/bugpoint/CrashDebugger.cpp
@@ -54,6 +54,9 @@
   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 @@
   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';
Index: llvm/docs/CommandGuide/bugpoint.rst
===================================================================
--- llvm/docs/CommandGuide/bugpoint.rst
+++ llvm/docs/CommandGuide/bugpoint.rst
@@ -176,6 +176,14 @@
  **--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
 -----------
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22411.64196.patch
Type: text/x-patch
Size: 1559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160715/e949bab3/attachment.bin>


More information about the llvm-commits mailing list