mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Do not raise free() call that is called through invoke instruction.
llvm-svn: 43083
This commit is contained in:
parent
4cbb4f081b
commit
9cb3c09156
@ -204,6 +204,8 @@ bool RaiseAllocations::runOnModule(Module &M) {
|
||||
Users.pop_back();
|
||||
|
||||
if (Instruction *I = dyn_cast<Instruction>(U)) {
|
||||
if (isa<InvokeInst>(I))
|
||||
continue;
|
||||
CallSite CS = CallSite::get(I);
|
||||
if (CS.getInstruction() && !CS.arg_empty() &&
|
||||
(CS.getCalledFunction() == FreeFunc ||
|
||||
|
17
test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll
Normal file
17
test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll
Normal file
@ -0,0 +1,17 @@
|
||||
; RUN: llvm-as <%s | opt -raiseallocs -stats -disable-output |& \
|
||||
; RUN: not grep {Number of allocations raised}
|
||||
define void @foo() {
|
||||
entry:
|
||||
%buffer = alloca i16*
|
||||
%tmp = load i16** %buffer, align 8
|
||||
invoke i32(...)* @free(i16* %tmp)
|
||||
to label %invcont unwind label %unwind
|
||||
invcont:
|
||||
br label %finally
|
||||
unwind:
|
||||
br label %finally
|
||||
finally:
|
||||
ret void
|
||||
}
|
||||
declare i32 @free(...)
|
||||
|
Loading…
x
Reference in New Issue
Block a user