summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/LLParser.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/AsmParser/LLParser.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/AsmParser/LLParser.cpp')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 271567bd1e9..52fd2b21e1a 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -2800,7 +2800,7 @@ bool LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
// Memory.
case lltok::kw_alloca: return ParseAlloc(Inst, PFS);
case lltok::kw_malloc: return ParseAlloc(Inst, PFS, BB, false);
- case lltok::kw_free: return ParseFree(Inst, PFS);
+ case lltok::kw_free: return ParseFree(Inst, PFS, BB);
case lltok::kw_load: return ParseLoad(Inst, PFS, false);
case lltok::kw_store: return ParseStore(Inst, PFS, false);
case lltok::kw_volatile:
@@ -3496,12 +3496,13 @@ bool LLParser::ParseAlloc(Instruction *&Inst, PerFunctionState &PFS,
/// ParseFree
/// ::= 'free' TypeAndValue
-bool LLParser::ParseFree(Instruction *&Inst, PerFunctionState &PFS) {
+bool LLParser::ParseFree(Instruction *&Inst, PerFunctionState &PFS,
+ BasicBlock* BB) {
Value *Val; LocTy Loc;
if (ParseTypeAndValue(Val, Loc, PFS)) return true;
if (!isa<PointerType>(Val->getType()))
return Error(Loc, "operand to free must be a pointer");
- Inst = new FreeInst(Val);
+ Inst = CallInst::CreateFree(Val, BB);
return false;
}
OpenPOWER on IntegriCloud