Allow DIBuilder::replaceVTableHolder() to work with temporary nodes,

tested via the clang test CodeGenCXX/vtable-holder-self-reference.cpp .

llvm-svn: 228854
This commit is contained in:
Adrian Prantl 2015-02-11 17:45:10 +00:00
parent 9a8049238e
commit 18a25b016e
1 changed files with 6 additions and 6 deletions

View File

@ -1229,12 +1229,12 @@ void DIBuilder::replaceVTableHolder(DICompositeType &T, DICompositeType VTableHo
if (T != VTableHolder)
return;
// Look for unresolved operands. T has dropped RAUW support and is already
// marked resolved, orphaning any cycles underneath it.
assert(T->isResolved() && "Expected self-reference to be resolved");
for (const MDOperand &O : T->operands())
if (auto *N = dyn_cast_or_null<MDNode>(O))
trackIfUnresolved(N);
// Look for unresolved operands. T will drop RAUW support, orphaning any
// cycles underneath it.
if (T->isResolved())
for (const MDOperand &O : T->operands())
if (auto *N = dyn_cast_or_null<MDNode>(O))
trackIfUnresolved(N);
}
void DIBuilder::replaceArrays(DICompositeType &T, DIArray Elements,