mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-23 20:29:30 +00:00
AsmWriter: Assert on unresolved metadata nodes
Assert that `MDNode::isResolved()`. While in theory the `Verifier` should catch this, it doesn't descend into all debug info, and the `DebugInfoVerifier` doesn't call into the `Verifier`. Besides, this helps to catch bugs when `-disable-verify=true`. Note that I haven't come across a place where this fails with clang today, so no testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232442 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6837ab53fb
commit
b47d918825
@ -1205,6 +1205,8 @@ static void WriteModuleMetadata(const Module *M,
|
||||
SmallVector<uint64_t, 64> Record;
|
||||
for (const Metadata *MD : MDs) {
|
||||
if (const MDNode *N = dyn_cast<MDNode>(MD)) {
|
||||
assert(N->isResolved() && "Expected forward references to be resolved");
|
||||
|
||||
switch (N->getMetadataID()) {
|
||||
default:
|
||||
llvm_unreachable("Invalid MDNode subclass");
|
||||
|
Loading…
x
Reference in New Issue
Block a user