From 39aebca3a2d1dd389a6d9cdfb51a53f625e244f0 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 24 Apr 2003 22:24:22 +0000 Subject: [PATCH] Adjust to match new ListReducer interface Move function to generic code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5910 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/Miscompilation.cpp | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index 89854f52c3f..0ed35c83895 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -32,13 +32,13 @@ class ReduceMiscompilingPasses : public ListReducer { public: ReduceMiscompilingPasses(BugDriver &bd) : BD(bd) {} - virtual TestResult doTest(const std::vector &Prefix, - const std::vector &Kept); + virtual TestResult doTest(std::vector &Prefix, + std::vector &Kept); }; ReduceMiscompilingPasses::TestResult -ReduceMiscompilingPasses::doTest(const std::vector &Prefix, - const std::vector &Kept) { +ReduceMiscompilingPasses::doTest(std::vector &Prefix, + std::vector &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 { public: ReduceMiscompilingFunctions(BugDriver &bd) : BD(bd) {} - virtual TestResult doTest(const std::vector &Prefix, - const std::vector &Kept) { + virtual TestResult doTest(std::vector &Prefix, + std::vector &Kept) { if (TestFuncs(Kept, false)) return KeepSuffix; if (!Prefix.empty() && TestFuncs(Prefix, false)) @@ -147,21 +147,6 @@ public: bool TestFuncs(const std::vector &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 &Funcs, bool EmitBytecode) { // Test to see if the function is misoptimized if we ONLY run it on the -- 2.34.1