aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/LLVMContext.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-05-19 20:10:19 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-05-19 20:10:19 +0000
commitf999547d11249ff13853683d5ca63383593ef4fd (patch)
treee63c5ec16e1e0b2a27ad3a86234090570d9f1f82 /llvm/lib/IR/LLVMContext.cpp
parent03abbb48a43840bc6d102b94a000a1c09fe036d7 (diff)
downloadllvm-f999547d11249ff13853683d5ca63383593ef4fd.zip
llvm-f999547d11249ff13853683d5ca63383593ef4fd.tar.gz
llvm-f999547d11249ff13853683d5ca63383593ef4fd.tar.bz2
Dereferenceable, dereferenceable_or_null metadata for loads
Summary: Introduce dereferenceable, dereferenceable_or_null metadata for loads with the same semantic as corresponding attributes. This patch depends on http://reviews.llvm.org/D9253 Patch by Artur Pilipenko! Reviewers: hfinkel, sanjoy, reames Reviewed By: sanjoy, reames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9365 llvm-svn: 237720
Diffstat (limited to 'llvm/lib/IR/LLVMContext.cpp')
-rw-r--r--llvm/lib/IR/LLVMContext.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index b6d95c4f..44c4532 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -88,11 +88,22 @@ LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) {
"mem_parallel_loop_access kind id drifted");
(void)MemParallelLoopAccessID;
-
// Create the 'nonnull' metadata kind.
unsigned NonNullID = getMDKindID("nonnull");
assert(NonNullID == MD_nonnull && "nonnull kind id drifted");
(void)NonNullID;
+
+ // Create the 'dereferenceable' metadata kind.
+ unsigned DereferenceableID = getMDKindID("dereferenceable");
+ assert(DereferenceableID == MD_dereferenceable &&
+ "dereferenceable kind id drifted");
+ (void)DereferenceableID;
+
+ // Create the 'dereferenceable_or_null' metadata kind.
+ unsigned DereferenceableOrNullID = getMDKindID("dereferenceable_or_null");
+ assert(DereferenceableOrNullID == MD_dereferenceable_or_null &&
+ "dereferenceable_or_null kind id drifted");
+ (void)DereferenceableOrNullID;
}
LLVMContext::~LLVMContext() { delete pImpl; }