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