summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Pop <sebpop@gmail.com>2016-07-15 23:15:06 +0000
committerSebastian Pop <sebpop@gmail.com>2016-07-15 23:15:06 +0000
commit8f7d01992cf988d45d2d8cb772a7ab739761a38b (patch)
tree3f554984f4e8d857d0a6ae03b9c12a8ce549d34d
parentd06239d359df71ee594c1b305fe71af59793abc2 (diff)
downloadbcm5719-llvm-8f7d01992cf988d45d2d8cb772a7ab739761a38b.tar.gz
bcm5719-llvm-8f7d01992cf988d45d2d8cb772a7ab739761a38b.zip
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 llvm-svn: 275646
-rw-r--r--llvm/docs/CommandGuide/bugpoint.rst8
-rw-r--r--llvm/tools/bugpoint/CrashDebugger.cpp8
2 files changed, 15 insertions, 1 deletions
diff --git a/llvm/docs/CommandGuide/bugpoint.rst b/llvm/docs/CommandGuide/bugpoint.rst
index 2e6341de719..8c2a0d12498 100644
--- a/llvm/docs/CommandGuide/bugpoint.rst
+++ b/llvm/docs/CommandGuide/bugpoint.rst
@@ -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
-----------
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp
index 07fe0d7acbd..b25e6ecec19 100644
--- a/llvm/tools/bugpoint/CrashDebugger.cpp
+++ b/llvm/tools/bugpoint/CrashDebugger.cpp
@@ -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 BugDriver &BD, Module *M) {
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';
OpenPOWER on IntegriCloud