summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2009-10-24 04:23:03 +0000
committerVictor Hernandez <vhernandez@apple.com>2009-10-24 04:23:03 +0000
commite297149e267e05159db4dc490493fddcb3784d95 (patch)
tree4f49152e0dfd1305070ba4ab33c516f5fe31ebab /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent46ed1f83414d1e93e5af6a8145526c0d216861c1 (diff)
downloadbcm5719-llvm-e297149e267e05159db4dc490493fddcb3784d95.tar.gz
bcm5719-llvm-e297149e267e05159db4dc490493fddcb3784d95.zip
Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst. Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised. llvm-svn: 84987
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 3a385cbe382..ffd330c74ec 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -2073,7 +2073,8 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
if (getValueTypePair(Record, OpNum, NextValueNo, Op) ||
OpNum != Record.size())
return Error("Invalid FREE record");
- I = new FreeInst(Op);
+ if (!CurBB) return Error("Invalid free instruction with no BB");
+ I = CallInst::CreateFree(Op, CurBB);
InstructionList.push_back(I);
break;
}
OpenPOWER on IntegriCloud