diff options
| author | Adrian Prantl <aprantl@apple.com> | 2016-10-05 21:31:19 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2016-10-05 21:31:19 +0000 |
| commit | 71bba7253e1465daa02a79644baa23926e6b4ccc (patch) | |
| tree | 36acfa31cde3bfbf93f41493e53bede1e007b0c7 /llvm/lib | |
| parent | 5a68ec7f0910444c240175e0ab745565ead416b3 (diff) | |
| download | bcm5719-llvm-71bba7253e1465daa02a79644baa23926e6b4ccc.tar.gz bcm5719-llvm-71bba7253e1465daa02a79644baa23926e6b4ccc.zip | |
Verifier: Reject any unknown named MD nodes in the llvm.dbg namespace.
This came out of a discussion in https://reviews.llvm.org/D25285.
There used to be various other llvm.dbg.* nodes, but we don't support
upgrading them and we want to reserve the namespace for future uses.
This also removes an entirely obsolete and bitrotted testcase for PR7662.
llvm-svn: 283390
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/IR/Verifier.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 980cb7746ec..7eea5170b94 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -698,10 +698,15 @@ void Verifier::visitGlobalAlias(const GlobalAlias &GA) { } void Verifier::visitNamedMDNode(const NamedMDNode &NMD) { + // There used to be various other llvm.dbg.* nodes, but we don't support + // upgrading them and we want to reserve the namespace for future uses. + if (NMD.getName().startswith("llvm.dbg.")) + AssertDI(NMD.getName() == "llvm.dbg.cu", + "unrecognized named metadata node in the llvm.dbg namespace", + &NMD); for (const MDNode *MD : NMD.operands()) { - if (NMD.getName() == "llvm.dbg.cu") { + if (NMD.getName() == "llvm.dbg.cu") AssertDI(MD && isa<DICompileUnit>(MD), "invalid compile unit", &NMD, MD); - } if (!MD) continue; |

