mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Turn 'free null' into nothing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11940 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9e4a642c03
commit
6160e85201
@ -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…
Reference in New Issue
Block a user