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:
f2c3106
)
If changing a parent, don't add then remove the object from the leak detector
author
Chris Lattner
<sabre@nondot.org>
Wed, 4 Feb 2004 01:06:38 +0000
(
01:06
+0000)
committer
Chris Lattner
<sabre@nondot.org>
Wed, 4 Feb 2004 01:06:38 +0000
(
01:06
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11106
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/VMCore/Instruction.cpp
patch
|
blob
|
history
diff --git
a/lib/VMCore/Instruction.cpp
b/lib/VMCore/Instruction.cpp
index 6f2480bdde7b113c5d1ab509fbc106ff14cea087..b009c01eecb7cae95c16657e458b950949cad58f 100644
(file)
--- a/
lib/VMCore/Instruction.cpp
+++ b/
lib/VMCore/Instruction.cpp
@@
-35,13
+35,13
@@
Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
}
void Instruction::setParent(BasicBlock *P) {
- if (getParent())
- LeakDetector::addGarbageObject(this);
+ if (getParent()) {
+ if (!P) LeakDetector::addGarbageObject(this);
+ } else {
+ if (P) LeakDetector::removeGarbageObject(this);
+ }
Parent = P;
-
- if (getParent())
- LeakDetector::removeGarbageObject(this);
}
// Specialize setName to take care of symbol table majik