summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: de246de)
raw | patch | inline | side by side (parent: de246de)
author | Philip Reames <listmail@philipreames.com> | |
Tue, 21 Oct 2014 20:56:29 +0000 (20:56 +0000) | ||
committer | Philip Reames <listmail@philipreames.com> | |
Tue, 21 Oct 2014 20:56:29 +0000 (20:56 +0000) |
The recently added !nonnull metadata is only valid on loads of pointer type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220323 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220323 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/Verifier.cpp | patch | blob | history |
diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp
index 154d54870efb1ae353cd92173ff391e8e9eb516b..3060baa52e2f743f253c5f44cd99a83c9062516c 100644 (file)
--- a/lib/IR/Verifier.cpp
+++ b/lib/IR/Verifier.cpp
visitRangeMetadata(I, Range, I.getType());
}
+ if (I.getMetadata(LLVMContext::MD_nonnull)) {
+ Assert1(I.getType()->isPointerTy(),
+ "nonnull applies only to pointer types", &I);
+ Assert1(isa<LoadInst>(I),
+ "nonnull applies only to load instructions, use attributes"
+ " for calls or invokes", &I);
+ }
+
InstsInThisBlock.insert(&I);
}