forked from OSchip/llvm-project
If changing a parent, don't add then remove the object from the leak detector
llvm-svn: 11106
This commit is contained in:
parent
c4c7ea5288
commit
d8a232b716
|
@ -35,13 +35,13 @@ Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
|
||||||
}
|
}
|
||||||
|
|
||||||
void Instruction::setParent(BasicBlock *P) {
|
void Instruction::setParent(BasicBlock *P) {
|
||||||
if (getParent())
|
if (getParent()) {
|
||||||
LeakDetector::addGarbageObject(this);
|
if (!P) LeakDetector::addGarbageObject(this);
|
||||||
|
} else {
|
||||||
|
if (P) LeakDetector::removeGarbageObject(this);
|
||||||
|
}
|
||||||
|
|
||||||
Parent = P;
|
Parent = P;
|
||||||
|
|
||||||
if (getParent())
|
|
||||||
LeakDetector::removeGarbageObject(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Specialize setName to take care of symbol table majik
|
// Specialize setName to take care of symbol table majik
|
||||||
|
|
Loading…
Reference in New Issue