mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-26 13:10:42 +00:00
Move function from Miscompilation.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5908 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
126840f49e
commit
ff4aaf0010
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user