diff options
author | Chris Lattner <sabre@nondot.org> | 2004-03-14 20:50:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-03-14 20:50:42 +0000 |
commit | efdc0b505712d1ca4460def27e51c430f033d58d (patch) | |
tree | cf9c16dc624f0c78d238bad288dd5b2e83515245 /tools/bugpoint/BugDriver.h | |
parent | a1a7148c4de22a2cedc76b97ef80569b36698342 (diff) |
Refactor and clean up a bunch more code. No major functionality changes.
* Make several methods of bugdriver global functions (ParseInputFile, PrintFunctionList)
* Make PrintFunctionList truncate the output after 10 entries, like the crash debugger
did. This allows code sharing.
* Add a couple of methods to BugDriver that allows us to eliminate some friends
* Improve comments in ExtractFunction.cpp
* Make classes that used to be friends up bugdriver now live in anon namespaces
* Rip a bunch of functionality in the miscompilation tester into a new
TestMergedProgram function for future code sharing.
* Fix a bug in the miscompilation tester induced in my last checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12393 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/BugDriver.h')
-rw-r--r-- | tools/bugpoint/BugDriver.h | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/tools/bugpoint/BugDriver.h b/tools/bugpoint/BugDriver.h index eb48eb7d9c..a4428cffea 100644 --- a/tools/bugpoint/BugDriver.h +++ b/tools/bugpoint/BugDriver.h @@ -28,8 +28,6 @@ class AbstractInterpreter; class Instruction; class DebugCrashes; -class ReduceMiscompilingPasses; -class ReduceMiscompilingFunctions; class CBE; class GCC; @@ -47,8 +45,6 @@ class BugDriver { // FIXME: sort out public/private distinctions... friend class ReducePassList; - friend class ReduceMiscompilingPasses; - friend class ReduceMiscompilingFunctions; friend class ReduceMisCodegenFunctions; public: @@ -65,6 +61,9 @@ public: void setPassesToRun(const std::vector<const PassInfo*> &PTR) { PassesToRun = PTR; } + const std::vector<const PassInfo*> &getPassesToRun() const { + return PassesToRun; + } /// run - The top level method that is invoked after all of the instance /// variables are set up from command line arguments. @@ -120,7 +119,15 @@ public: return Result; } - const Module *getProgram() const { return Program; } + Module *getProgram() const { return Program; } + + /// swapProgramIn - Set the current module to the specified module, returning + /// the old one. + Module *swapProgramIn(Module *M) { + Module *OldProgram = Program; + Program = M; + return OldProgram; + } /// setNewProgram - If we reduce or update the program somehow, call this /// method to update bugdriver with it. This deletes the old module and sets @@ -183,17 +190,6 @@ public: /// program or if the loop extractor crashes. Module *ExtractLoop(Module *M); -private: - /// ParseInputFile - Given a bytecode or assembly input filename, parse and - /// return it, or return null if not possible. - /// - Module *ParseInputFile(const std::string &InputFilename) const; - - /// writeProgramToFile - This writes the current "Program" to the named - /// bytecode file. If an error occurs, true is returned. - /// - bool writeProgramToFile(const std::string &Filename, Module *M = 0) const; - /// runPasses - Run the specified passes on Program, outputting a bytecode /// file and writting the filename into OutputFile if successful. If the /// optimizations fail for some reason (optimizer crashes), return true, @@ -205,6 +201,11 @@ private: bool runPasses(const std::vector<const PassInfo*> &PassesToRun, std::string &OutputFilename, bool DeleteOutput = false, bool Quiet = false) const; +private: + /// writeProgramToFile - This writes the current "Program" to the named + /// bytecode file. If an error occurs, true is returned. + /// + bool writeProgramToFile(const std::string &Filename, Module *M = 0) const; /// runPasses - Just like the method above, but this just returns true or /// false indicating whether or not the optimizer crashed on the specified @@ -216,21 +217,27 @@ private: return runPasses(PassesToRun, Filename, DeleteOutput); } - /// PrintFunctionList - prints out list of problematic functions - /// - static void PrintFunctionList(const std::vector<Function*> &Funcs); - /// initializeExecutionEnvironment - This method is used to set up the /// environment for executing LLVM programs. /// bool initializeExecutionEnvironment(); }; +/// ParseInputFile - Given a bytecode or assembly input filename, parse and +/// return it, or return null if not possible. +/// +Module *ParseInputFile(const std::string &InputFilename); + + /// getPassesString - Turn a list of passes into a string which indicates the /// command line options that must be passed to add the passes. /// std::string getPassesString(const std::vector<const PassInfo*> &Passes); +/// PrintFunctionList - prints out list of problematic functions +/// +void PrintFunctionList(const std::vector<Function*> &Funcs); + // DeleteFunctionBody - "Remove" the function by deleting all of it's basic // blocks, making it external. // |