summaryrefslogtreecommitdiff
path: root/tools/bugpoint/BugDriver.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-24 22:23:34 +0000
committerChris Lattner <sabre@nondot.org>2003-04-24 22:23:34 +0000
commitff4aaf0010d11a4c42f58f839336669d5fd7ba03 (patch)
tree41fea2c40debf5ff18de84efaffd8e3aabe5aea7 /tools/bugpoint/BugDriver.cpp
parent126840f49e8d49156a342e836d4b2adca46dc3ba (diff)
downloadllvm-ff4aaf0010d11a4c42f58f839336669d5fd7ba03.tar.gz
llvm-ff4aaf0010d11a4c42f58f839336669d5fd7ba03.tar.bz2
llvm-ff4aaf0010d11a4c42f58f839336669d5fd7ba03.tar.xz
Move function from Miscompilation.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/BugDriver.cpp')
-rw-r--r--tools/bugpoint/BugDriver.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/bugpoint/BugDriver.cpp b/tools/bugpoint/BugDriver.cpp
index 05dff34b84..7a2ce26a85 100644
--- a/tools/bugpoint/BugDriver.cpp
+++ b/tools/bugpoint/BugDriver.cpp
@@ -27,6 +27,19 @@ std::string getPassesString(const std::vector<const PassInfo*> &Passes) {
return Result;
}
+// DeleteFunctionBody - "Remove" the function by deleting all of it's basic
+// blocks, making it external.
+//
+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!");
+}
/// ParseInputFile - Given a bytecode or assembly input filename, parse and
/// return it, or return null if not possible.