add a new (hidden) -disable-core-files option
authorChris Lattner <sabre@nondot.org>
Thu, 14 Sep 2006 06:17:09 +0000 (06:17 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 14 Sep 2006 06:17:09 +0000 (06:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30318 91177308-0d34-0410-b5e6-96231b3b80d8

tools/lli/lli.cpp

index be9f999a5467b211b6ac9e51b06503eef3771351..a9d905968f993ac5dff10d21c2f96b183d41afc9 100644 (file)
@@ -23,6 +23,7 @@
 #include "llvm/ExecutionEngine/GenericValue.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/PluginLoader.h"
+#include "llvm/System/Process.h"
 #include "llvm/System/Signals.h"
 #include <iostream>
 
@@ -45,6 +46,10 @@ namespace {
   FakeArgv0("fake-argv0",
             cl::desc("Override the 'argv[0]' value passed into the executing"
                      " program"), cl::value_desc("executable"));
+  
+  cl::opt<bool>
+  DisableCoreFiles("disable-core-files", cl::Hidden,
+                   cl::desc("Disable emission of core files if possible"));
 }
 
 //===----------------------------------------------------------------------===//
@@ -56,6 +61,10 @@ int main(int argc, char **argv, char * const *envp) {
                                 " llvm interpreter & dynamic compiler\n");
     sys::PrintStackTraceOnErrorSignal();
 
+    // If the user doesn't want core files, disable them.
+    if (DisableCoreFiles)
+      sys::Process::PreventCoreFiles();
+    
     // Load the bytecode...
     std::string ErrorMsg;
     ModuleProvider *MP = 0;