diff options
author | Chris Lattner <sabre@nondot.org> | 2003-04-24 22:24:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-04-24 22:24:22 +0000 |
commit | ba159e2824cc02ff5b9b06e97b2ee2e4a6e2812c (patch) | |
tree | 90df985948104e62dee01e35592c55021bf6b0ac | |
parent | 69f8e6f7aa72249abbe57242128d670983f1326a (diff) | |
download | bcm5719-llvm-ba159e2824cc02ff5b9b06e97b2ee2e4a6e2812c.tar.gz bcm5719-llvm-ba159e2824cc02ff5b9b06e97b2ee2e4a6e2812c.zip |
Adjust to match new ListReducer interface
Move function to generic code
llvm-svn: 5910
-rw-r--r-- | llvm/tools/bugpoint/Miscompilation.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp index 89854f52c3f..0ed35c83895 100644 --- a/llvm/tools/bugpoint/Miscompilation.cpp +++ b/llvm/tools/bugpoint/Miscompilation.cpp @@ -32,13 +32,13 @@ class ReduceMiscompilingPasses : public ListReducer<const PassInfo*> { public: ReduceMiscompilingPasses(BugDriver &bd) : BD(bd) {} - virtual TestResult doTest(const std::vector<const PassInfo*> &Prefix, - const std::vector<const PassInfo*> &Kept); + virtual TestResult doTest(std::vector<const PassInfo*> &Prefix, + std::vector<const PassInfo*> &Kept); }; ReduceMiscompilingPasses::TestResult -ReduceMiscompilingPasses::doTest(const std::vector<const PassInfo*> &Prefix, - const std::vector<const PassInfo*> &Kept) { +ReduceMiscompilingPasses::doTest(std::vector<const PassInfo*> &Prefix, + std::vector<const PassInfo*> &Kept) { // First, run the program with just the Kept passes. If it is still broken // with JUST the kept passes, discard the prefix passes. std::cout << "Checking to see if '" << getPassesString(Kept) @@ -135,8 +135,8 @@ class ReduceMiscompilingFunctions : public ListReducer<Function*> { public: ReduceMiscompilingFunctions(BugDriver &bd) : BD(bd) {} - virtual TestResult doTest(const std::vector<Function*> &Prefix, - const std::vector<Function*> &Kept) { + virtual TestResult doTest(std::vector<Function*> &Prefix, + std::vector<Function*> &Kept) { if (TestFuncs(Kept, false)) return KeepSuffix; if (!Prefix.empty() && TestFuncs(Prefix, false)) @@ -147,21 +147,6 @@ public: bool TestFuncs(const std::vector<Function*> &Prefix, bool EmitBytecode); }; -// DeleteFunctionBody - "Remove" the function by deleting all of it's basic -// blocks, making it external. -// -static void DeleteFunctionBody(Function *F) { - // First, break circular use/def chain references... - for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) - I->dropAllReferences(); - - // Next, delete all of the basic blocks. - F->getBasicBlockList().clear(); - - assert(F->isExternal() && "This didn't make the function external!"); -} - - bool ReduceMiscompilingFunctions::TestFuncs(const std::vector<Function*> &Funcs, bool EmitBytecode) { // Test to see if the function is misoptimized if we ONLY run it on the |