diff options
author | Chris Lattner <sabre@nondot.org> | 2004-02-18 21:24:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-02-18 21:24:48 +0000 |
commit | 06905db7d2a2b83c1b3236d5552629ada2d8d56d (patch) | |
tree | a35eb44b9b64682fd9276db1677e2147ca2693c8 /tools/bugpoint/BugDriver.h | |
parent | 025262692a6710de29a48e2b3905672cd12d13d2 (diff) | |
download | llvm-06905db7d2a2b83c1b3236d5552629ada2d8d56d.tar.gz llvm-06905db7d2a2b83c1b3236d5552629ada2d8d56d.tar.bz2 llvm-06905db7d2a2b83c1b3236d5552629ada2d8d56d.tar.xz |
Cleanup and simplify manipulation of the program, eliminate the need for so
many 'friends' of bugdriver.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11603 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/BugDriver.h')
-rw-r--r-- | tools/bugpoint/BugDriver.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/tools/bugpoint/BugDriver.h b/tools/bugpoint/BugDriver.h index 4d6754aa7c..a5f1e3f356 100644 --- a/tools/bugpoint/BugDriver.h +++ b/tools/bugpoint/BugDriver.h @@ -48,12 +48,10 @@ class BugDriver { GCC *gcc; // FIXME: sort out public/private distinctions... - friend class DebugCrashes; + friend class ReducePassList; friend class ReduceMiscompilingPasses; friend class ReduceMiscompilingFunctions; friend class ReduceMisCodegenFunctions; - friend class ReduceCrashingFunctions; - friend class ReduceCrashingBlocks; public: BugDriver(const char *toolname); @@ -114,6 +112,23 @@ public: /// bool isExecutingJIT(); + /// runPasses - Run all of the passes in the "PassesToRun" list, discard the + /// output, and return true if any of the passes crashed. + bool runPasses(Module *M = 0) { + if (M == 0) M = Program; + std::swap(M, Program); + bool Result = runPasses(PassesToRun); + std::swap(M, Program); + return Result; + } + + const Module *getProgram() const { return Program; } + + /// setNewProgram - If we reduce or update the program somehow, call this + /// method to update bugdriver with it. This deletes the old module and sets + /// the specified one as the current program. + void setNewProgram(Module *M); + private: /// ParseInputFile - Given a bytecode or assembly input filename, parse and /// return it, or return null if not possible. |