[PATCH] Add isConstant argument to MDBuilder::createTBAAStructTagNode
Artur Pilipenko
apilipenko at azulsystems.com
Mon Jun 1 06:04:42 PDT 2015
According to the TBAA description struct-path tag node can have an optional IsConstant field. Add corresponding argument to MDBuilder::createTBAAStructTagNode.
http://reviews.llvm.org/D10160
Files:
include/llvm/IR/MDBuilder.h
lib/IR/MDBuilder.cpp
Index: include/llvm/IR/MDBuilder.h
===================================================================
--- include/llvm/IR/MDBuilder.h
+++ include/llvm/IR/MDBuilder.h
@@ -153,7 +153,7 @@
/// \brief Return metadata for a TBAA tag node with the given
/// base type, access type and offset relative to the base type.
MDNode *createTBAAStructTagNode(MDNode *BaseType, MDNode *AccessType,
- uint64_t Offset);
+ uint64_t Offset, bool IsConstant = false);
};
} // end namespace llvm
Index: lib/IR/MDBuilder.cpp
===================================================================
--- lib/IR/MDBuilder.cpp
+++ lib/IR/MDBuilder.cpp
@@ -168,9 +168,10 @@
/// \brief Return metadata for a TBAA tag node with the given
/// base type, access type and offset relative to the base type.
MDNode *MDBuilder::createTBAAStructTagNode(MDNode *BaseType, MDNode *AccessType,
- uint64_t Offset) {
+ uint64_t Offset, bool IsConstant) {
Type *Int64 = Type::getInt64Ty(Context);
- Metadata *Ops[3] = {BaseType, AccessType,
- createConstant(ConstantInt::get(Int64, Offset))};
+ Metadata *Ops[4] = {BaseType, AccessType,
+ createConstant(ConstantInt::get(Int64, Offset)),
+ createConstant(ConstantInt::get(Int64, IsConstant))};
return MDNode::get(Context, Ops);
}
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10160.26896.patch
Type: text/x-patch
Size: 1472 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150601/8d275668/attachment.bin>
More information about the llvm-commits
mailing list