From e297149e267e05159db4dc490493fddcb3784d95 Mon Sep 17 00:00:00 2001 From: Victor Hernandez Date: Sat, 24 Oct 2009 04:23:03 +0000 Subject: 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 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') 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; } -- cgit v1.2.3