[llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Apr 24 17:24:01 PDT 2003
Changes in directory llvm/tools/bugpoint:
BugDriver.cpp updated: 1.3 -> 1.4
---
Log message:
Move function from Miscompilation.cpp
---
Diffs of the changes:
Index: llvm/tools/bugpoint/BugDriver.cpp
diff -u llvm/tools/bugpoint/BugDriver.cpp:1.3 llvm/tools/bugpoint/BugDriver.cpp:1.4
--- llvm/tools/bugpoint/BugDriver.cpp:1.3 Thu Apr 24 12:02:17 2003
+++ llvm/tools/bugpoint/BugDriver.cpp Thu Apr 24 17:23:34 2003
@@ -27,6 +27,19 @@
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.
More information about the llvm-commits
mailing list