forked from OSchip/llvm-project
Verifier: !llvm.dbg.cu must point at compile units
Duplicate this check from `verifyDebugInfo()`. llvm-svn: 233094
This commit is contained in:
parent
a9dccd41e9
commit
f238c78c4c
|
@ -111,6 +111,13 @@ private:
|
|||
OS << '\n';
|
||||
}
|
||||
|
||||
void Write(const NamedMDNode *NMD) {
|
||||
if (!NMD)
|
||||
return;
|
||||
NMD->print(OS);
|
||||
OS << '\n';
|
||||
}
|
||||
|
||||
void Write(Type *T) {
|
||||
if (!T)
|
||||
return;
|
||||
|
@ -562,6 +569,10 @@ void Verifier::visitNamedMDNode(const NamedMDNode &NMD) {
|
|||
if (!MD)
|
||||
continue;
|
||||
|
||||
if (NMD.getName() == "llvm.dbg.cu") {
|
||||
Assert(isa<MDCompileUnit>(MD), "invalid compile unit", &NMD, MD);
|
||||
}
|
||||
|
||||
visitMDNode(*MD);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue