summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-09 00:41:28 +0000
committerChris Lattner <sabre@nondot.org>2009-12-09 00:41:28 +0000
commit4b2a6e200f0836e7fcbc3f8a7416648c2b2929d0 (patch)
tree3aef8b2ddb802f9e674eb0f5ee1cf106144a1305 /llvm/tools
parent56a5f19c70f0821c0810c471a6ccda2bbed39319 (diff)
downloadbcm5719-llvm-4b2a6e200f0836e7fcbc3f8a7416648c2b2929d0.tar.gz
bcm5719-llvm-4b2a6e200f0836e7fcbc3f8a7416648c2b2929d0.zip
when opt crashes, print its command line arguments as a pretty stack trace.
Somehow opt was missed when this was added. llvm-svn: 90912
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/opt/opt.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 12bb2ec2c7c..50a2e390ce6 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -30,6 +30,7 @@
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/PluginLoader.h"
+#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/StandardPasses.h"
#include "llvm/Support/SystemUtils.h"
#include "llvm/Support/raw_ostream.h"
@@ -340,12 +341,14 @@ void AddStandardLinkPasses(PassManager &PM) {
// main for opt
//
int main(int argc, char **argv) {
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
+ sys::PrintStackTraceOnErrorSignal();
+ llvm::PrettyStackTraceProgram X(argc, argv);
+
+ llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
LLVMContext &Context = getGlobalContext();
cl::ParseCommandLineOptions(argc, argv,
"llvm .bc -> .bc modular optimizer and analysis printer\n");
- sys::PrintStackTraceOnErrorSignal();
// Allocate a full target machine description only if necessary.
// FIXME: The choice of target should be controllable on the command line.
OpenPOWER on IntegriCloud