mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-30 00:24:00 +00:00
If changing a parent, don't add then remove the object from the leak detector
llvm-svn: 11106
This commit is contained in:
parent
1404b61b62
commit
7f1e6f16c5
@ -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…
x
Reference in New Issue
Block a user