[llvm] r228854 - Allow DIBuilder::replaceVTableHolder() to work with temporary nodes,
Adrian Prantl
aprantl at apple.com
Wed Feb 11 09:45:11 PST 2015
Author: adrian
Date: Wed Feb 11 11:45:10 2015
New Revision: 228854
URL: http://llvm.org/viewvc/llvm-project?rev=228854&view=rev
Log:
Allow DIBuilder::replaceVTableHolder() to work with temporary nodes,
tested via the clang test CodeGenCXX/vtable-holder-self-reference.cpp .
Modified:
llvm/trunk/lib/IR/DIBuilder.cpp
Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=228854&r1=228853&r2=228854&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Wed Feb 11 11:45:10 2015
@@ -1229,12 +1229,12 @@ void DIBuilder::replaceVTableHolder(DICo
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,
More information about the llvm-commits
mailing list