[PATCH] D11698: Introduce enum value for previously defined metadata -- make.implicit
Chen Li
meloli87 at gmail.com
Fri Jul 31 23:24:54 PDT 2015
chenli updated this revision to Diff 31189.
chenli added a comment.
Update w.r.t Philip's comments.
http://reviews.llvm.org/D11698
Files:
include/llvm/IR/LLVMContext.h
lib/CodeGen/ImplicitNullChecks.cpp
lib/IR/LLVMContext.cpp
Index: lib/IR/LLVMContext.cpp
===================================================================
--- lib/IR/LLVMContext.cpp
+++ lib/IR/LLVMContext.cpp
@@ -104,6 +104,12 @@
assert(DereferenceableOrNullID == MD_dereferenceable_or_null &&
"dereferenceable_or_null kind id drifted");
(void)DereferenceableOrNullID;
+
+ // Create the 'make.implicit' metadata kind.
+ unsigned MakeImplicitID = getMDKindID("make.implicit");
+ assert(MakeImplicitID == MD_make_implicit &&
+ "make.implicit kind id drifted");
+ (void)MakeImplicitID;
}
LLVMContext::~LLVMContext() { delete pImpl; }
Index: lib/CodeGen/ImplicitNullChecks.cpp
===================================================================
--- lib/CodeGen/ImplicitNullChecks.cpp
+++ lib/CodeGen/ImplicitNullChecks.cpp
@@ -38,6 +38,7 @@
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Instruction.h"
+#include "llvm/IR/LLVMContext.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetSubtargetInfo.h"
@@ -134,7 +135,7 @@
MDNode *BranchMD =
MBB.getBasicBlock()
- ? MBB.getBasicBlock()->getTerminator()->getMetadata("make.implicit")
+ ? MBB.getBasicBlock()->getTerminator()->getMetadata(LLVMContext::MD_make_implicit)
: nullptr;
if (!BranchMD)
return false;
Index: include/llvm/IR/LLVMContext.h
===================================================================
--- include/llvm/IR/LLVMContext.h
+++ include/llvm/IR/LLVMContext.h
@@ -60,7 +60,8 @@
MD_mem_parallel_loop_access = 10, // "llvm.mem.parallel_loop_access"
MD_nonnull = 11, // "nonnull"
MD_dereferenceable = 12, // "dereferenceable"
- MD_dereferenceable_or_null = 13 // "dereferenceable_or_null"
+ MD_dereferenceable_or_null = 13, // "dereferenceable_or_null"
+ MD_make_implicit = 14 // "make.implicit"
};
/// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11698.31189.patch
Type: text/x-patch
Size: 2001 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150801/a46f0366/attachment.bin>
More information about the llvm-commits
mailing list