mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-30 16:17:05 +00:00 
			
		
		
		
	when opt crashes, print its command line arguments as a pretty stack trace.
Somehow opt was missed when this was added. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90912 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -30,6 +30,7 @@ | |||||||
| #include "llvm/Support/ManagedStatic.h" | #include "llvm/Support/ManagedStatic.h" | ||||||
| #include "llvm/Support/MemoryBuffer.h" | #include "llvm/Support/MemoryBuffer.h" | ||||||
| #include "llvm/Support/PluginLoader.h" | #include "llvm/Support/PluginLoader.h" | ||||||
|  | #include "llvm/Support/PrettyStackTrace.h" | ||||||
| #include "llvm/Support/StandardPasses.h" | #include "llvm/Support/StandardPasses.h" | ||||||
| #include "llvm/Support/SystemUtils.h" | #include "llvm/Support/SystemUtils.h" | ||||||
| #include "llvm/Support/raw_ostream.h" | #include "llvm/Support/raw_ostream.h" | ||||||
| @@ -340,12 +341,14 @@ void AddStandardLinkPasses(PassManager &PM) { | |||||||
| // main for opt | // main for opt | ||||||
| // | // | ||||||
| int main(int argc, char **argv) { | 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(); |   LLVMContext &Context = getGlobalContext(); | ||||||
|    |    | ||||||
|   cl::ParseCommandLineOptions(argc, argv, |   cl::ParseCommandLineOptions(argc, argv, | ||||||
|     "llvm .bc -> .bc modular optimizer and analysis printer\n"); |     "llvm .bc -> .bc modular optimizer and analysis printer\n"); | ||||||
|   sys::PrintStackTraceOnErrorSignal(); |  | ||||||
|  |  | ||||||
|   // Allocate a full target machine description only if necessary. |   // Allocate a full target machine description only if necessary. | ||||||
|   // FIXME: The choice of target should be controllable on the command line. |   // FIXME: The choice of target should be controllable on the command line. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user