summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-24 17:18:03 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-24 17:18:03 +0000
commitf238c78c4c043d1c289f7bb91c8b0d8c71f1c7c0 (patch)
tree835428c8e203fd704b1cd1d9e1d422b9847f9702
parenta9dccd41e93956b294dea7769e418c81896ea349 (diff)
downloadbcm5719-llvm-f238c78c4c043d1c289f7bb91c8b0d8c71f1c7c0.tar.gz
bcm5719-llvm-f238c78c4c043d1c289f7bb91c8b0d8c71f1c7c0.zip
Verifier: !llvm.dbg.cu must point at compile units
Duplicate this check from `verifyDebugInfo()`. llvm-svn: 233094
-rw-r--r--llvm/lib/IR/Verifier.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 4f0e3388d58..d5a5afa0c40 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -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);
}
}
OpenPOWER on IntegriCloud