Verifier: Check that all instructions have their parent pointers set up

correctly. This helps with catching problems caused by IRBuilder abuse
such as the one fixed in CFE r222487.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222488 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl 2014-11-21 00:39:43 +00:00
parent 9c390888f7
commit c8ef21f1b1

View File

@ -1176,6 +1176,10 @@ void Verifier::visitBasicBlock(BasicBlock &BB) {
}
}
}
// Check that all instructions have their parent pointers set up correctly.
for (auto &I: BB)
Assert(I.getParent() == &BB, "Instruction has bogus parent pointer!");
}
void Verifier::visitTerminatorInst(TerminatorInst &I) {