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

Sebastian Pop via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 08:35:29 PDT 2016


sebpop created this revision.
sebpop added reviewers: reames, majnemer, rnk.
sebpop added a subscriber: llvm-commits.

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.


https://reviews.llvm.org/D22411

Files:
  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';


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


More information about the llvm-commits mailing list