summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/bugpoint.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-12-22 20:02:55 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-12-22 20:02:55 +0000
commit842118ce952aa5ff1f3fbf8a30e071248097ad46 (patch)
treea7570eacd9d50f9422f2cd001954050ad7ad3ae5 /llvm/tools/bugpoint/bugpoint.cpp
parentccd5b90f5874bfa4f92046f3ecac625b898efdaa (diff)
downloadbcm5719-llvm-842118ce952aa5ff1f3fbf8a30e071248097ad46.tar.gz
bcm5719-llvm-842118ce952aa5ff1f3fbf8a30e071248097ad46.zip
For PR351:
Generally, remove use of fork/exec from bugpoint in favor of the portable sys::Program::ExecuteAndWait method. This change requires two new options to bugpoint to tell it that it is running in "child" mode. In this mode, it reads its input and runs the passes. The result code signals to the parent instance of bugpoint what happened (success, fail, crash). This change should make bugpoint usable on Win32 systems. llvm-svn: 24961
Diffstat (limited to 'llvm/tools/bugpoint/bugpoint.cpp')
-rw-r--r--llvm/tools/bugpoint/bugpoint.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/bugpoint.cpp b/llvm/tools/bugpoint/bugpoint.cpp
index 0f25cf8a506..dde7286ae9f 100644
--- a/llvm/tools/bugpoint/bugpoint.cpp
+++ b/llvm/tools/bugpoint/bugpoint.cpp
@@ -24,6 +24,13 @@
#include "llvm/System/Signals.h"
using namespace llvm;
+// AsChild - Specifies that this invocation of bugpoint is being generated
+// from a parent process. It is not intended to be used by users so the
+// option is hidden.
+static cl::opt<bool>
+ AsChild("as-child", cl::desc("Run bugpoint as child process"),
+ cl::ReallyHidden);
+
static cl::list<std::string>
InputFilenames(cl::Positional, cl::OneOrMore,
cl::desc("<input llvm ll/bc files>"));
@@ -49,7 +56,7 @@ int main(int argc, char **argv) {
sys::PrintStackTraceOnErrorSignal();
sys::SetInterruptFunction(BugpointInterruptFunction);
- BugDriver D(argv[0]);
+ BugDriver D(argv[0],AsChild);
if (D.addSources(InputFilenames)) return 1;
D.addPasses(PassList.begin(), PassList.end());
OpenPOWER on IntegriCloud