summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2016-10-05 21:31:19 +0000
committerAdrian Prantl <aprantl@apple.com>2016-10-05 21:31:19 +0000
commit71bba7253e1465daa02a79644baa23926e6b4ccc (patch)
tree36acfa31cde3bfbf93f41493e53bede1e007b0c7 /llvm/lib
parent5a68ec7f0910444c240175e0ab745565ead416b3 (diff)
downloadbcm5719-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.cpp9
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;
OpenPOWER on IntegriCloud