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:
a1a9f40
)
Don't leak memory.
author
Owen Anderson
<resistor@mac.com>
Tue, 5 Jun 2007 22:11:49 +0000
(22:11 +0000)
committer
Owen Anderson
<resistor@mac.com>
Tue, 5 Jun 2007 22:11:49 +0000
(22:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37442
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/GVNPRE.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/GVNPRE.cpp
b/lib/Transforms/Scalar/GVNPRE.cpp
index b34239d6a612c910c4334be47e0d3894bce141c1..b93c70b0400d326a66dc94e07a95b1a0e21074a3 100644
(file)
--- a/
lib/Transforms/Scalar/GVNPRE.cpp
+++ b/
lib/Transforms/Scalar/GVNPRE.cpp
@@
-158,11
+158,14
@@
Value* GVNPRE::phi_translate(ValueTable& VN, std::set<Value*, ExprLT>& MS,
Value* newVal = BinaryOperator::create(BO->getOpcode(),
newOp1, newOp2,
BO->getName()+".gvnpre");
- add(VN, MS, newVal);
- if (!find_leader(VN, set, VN[newVal]))
+
+ if (!find_leader(VN, set, VN[newVal])) {
+ add(VN, MS, newVal);
return newVal;
- else
+ } else {
+ delete newVal;
return 0;
+ }
}
} else if (PHINode* P = dyn_cast<PHINode>(V)) {
if (P->getParent() == pred->getTerminator()->getSuccessor(0))