From c4bb052ecccfafa0ffa928d0b061db35734ee2ee Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Thu, 22 Dec 2005 20:02:55 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24961 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/bugpoint.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tools/bugpoint/bugpoint.cpp') diff --git a/tools/bugpoint/bugpoint.cpp b/tools/bugpoint/bugpoint.cpp index 0f25cf8a50..dde7286ae9 100644 --- a/tools/bugpoint/bugpoint.cpp +++ b/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 + AsChild("as-child", cl::desc("Run bugpoint as child process"), + cl::ReallyHidden); + static cl::list InputFilenames(cl::Positional, cl::OneOrMore, cl::desc("")); @@ -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()); -- cgit v1.2.3-70-g09d2