mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-29 16:12:44 +00:00
Turn 'free null' into nothing
llvm-svn: 11940
This commit is contained in:
parent
0b846ae65c
commit
192d8413d3
@ -2287,6 +2287,14 @@ Instruction *InstCombiner::visitFreeInst(FreeInst &FI) {
|
||||
return &FI;
|
||||
}
|
||||
|
||||
// If we have 'free null' delete the instruction. This can happen in stl code
|
||||
// when lots of inlining happens.
|
||||
if (isa<ConstantPointerNull>(Op)) {
|
||||
FI.getParent()->getInstList().erase(&FI);
|
||||
removeFromWorkList(&FI);
|
||||
return 0; // Don't do anything with FI
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user