mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
If changing a parent, don't add then remove the object from the leak detector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11106 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f2c3106866
commit
786993c01e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user