mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-13 15:37:24 +00:00
Add isConstant argument to MDBuilder::createTBAAStructTagNode
According to the TBAA description struct-path tag node can have an optional IsConstant field. Add corresponding argument to MDBuilder::createTBAAStructTagNode. Reviewed By: hfinkel Differential Revision: http://reviews.llvm.org/D10160 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238749 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8a6a249f6b
commit
d997435840
@ -153,7 +153,7 @@ public:
|
||||
/// \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
|
||||
|
@ -168,9 +168,16 @@ MDNode *MDBuilder::createTBAAScalarTypeNode(StringRef Name, MDNode *Parent,
|
||||
/// \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))};
|
||||
return MDNode::get(Context, Ops);
|
||||
if (IsConstant) {
|
||||
Metadata *Ops[4] = {BaseType, AccessType,
|
||||
createConstant(ConstantInt::get(Int64, Offset)),
|
||||
createConstant(ConstantInt::get(Int64, 1))};
|
||||
return MDNode::get(Context, Ops);
|
||||
} else {
|
||||
Metadata *Ops[3] = {BaseType, AccessType,
|
||||
createConstant(ConstantInt::get(Int64, Offset))};
|
||||
return MDNode::get(Context, Ops);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user