projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e4a642
)
Turn 'free null' into nothing
author
Chris Lattner
<sabre@nondot.org>
Sat, 28 Feb 2004 04:57:37 +0000
(
04:57
+0000)
committer
Chris Lattner
<sabre@nondot.org>
Sat, 28 Feb 2004 04:57:37 +0000
(
04:57
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11940
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/InstructionCombining.cpp
b/lib/Transforms/Scalar/InstructionCombining.cpp
index 0bf785360e860d85856f088fd62b616cf01f47dd..3054e13dfa62593990545eb1d2daa0ed171593ee 100644
(file)
--- a/
lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/
lib/Transforms/Scalar/InstructionCombining.cpp
@@
-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;
}