summaryrefslogtreecommitdiffstats
path: root/tools/bugpoint/BugDriver.h
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
commitc4bb052ecccfafa0ffa928d0b061db35734ee2ee (patch)
tree112af45c46e45f8bdca1007868b276d1d13a6bf7 /tools/bugpoint/BugDriver.h
parentd555f413cddb554203e3584047116fd97f6383d6 (diff)
downloadexternal_llvm-c4bb052ecccfafa0ffa928d0b061db35734ee2ee.zip
external_llvm-c4bb052ecccfafa0ffa928d0b061db35734ee2ee.tar.gz
external_llvm-c4bb052ecccfafa0ffa928d0b061db35734ee2ee.tar.bz2
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
Diffstat (limited to 'tools/bugpoint/BugDriver.h')
-rw-r--r--tools/bugpoint/BugDriver.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/bugpoint/BugDriver.h b/tools/bugpoint/BugDriver.h
index 192ed52..565a382 100644
--- a/tools/bugpoint/BugDriver.h
+++ b/tools/bugpoint/BugDriver.h
@@ -47,13 +47,14 @@ class BugDriver {
AbstractInterpreter *Interpreter; // How to run the program
CBE *cbe;
GCC *gcc;
+ bool run_as_child;
// FIXME: sort out public/private distinctions...
friend class ReducePassList;
friend class ReduceMisCodegenFunctions;
public:
- BugDriver(const char *toolname);
+ BugDriver(const char *toolname, bool as_child);
const std::string &getToolName() const { return ToolName; }
@@ -71,7 +72,8 @@ public:
}
/// run - The top level method that is invoked after all of the instance
- /// variables are set up from command line arguments.
+ /// variables are set up from command line arguments. The \p as_child argument
+ /// indicates whether the driver is to run in parent mode or child mode.
///
bool run();
@@ -249,6 +251,9 @@ private:
return runPasses(PassesToRun, Filename, DeleteOutput);
}
+ /// runAsChild - The actual "runPasses" guts that runs in a child process.
+ int runPassesAsChild(const std::vector<const PassInfo*> &PassesToRun);
+
/// initializeExecutionEnvironment - This method is used to set up the
/// environment for executing LLVM programs.
///