diff options
author | Manman Ren <mren@apple.com> | 2013-04-27 00:26:11 +0000 |
---|---|---|
committer | Manman Ren <mren@apple.com> | 2013-04-27 00:26:11 +0000 |
commit | a5b314c27a585b979ac9c9da944aa3cec27d22a6 (patch) | |
tree | 6920aff228604d7b4b359446caf305078db77347 /include | |
parent | 13131e62fc9a523b3cc8ad98cc9def97ff89391a (diff) |
Struct-path aware TBAA: change the format of TBAAStructType node.
We switch the order of offset and field type to make TBAAStructType node
(name, parent node, offset) similar to scalar TBAA node (name, parent node).
TypeIsImmutable is added to TBAAStructTag node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/IR/MDBuilder.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/llvm/IR/MDBuilder.h b/include/llvm/IR/MDBuilder.h index 074db78a76..ce81b5498f 100644 --- a/include/llvm/IR/MDBuilder.h +++ b/include/llvm/IR/MDBuilder.h @@ -159,26 +159,26 @@ public: /// \brief Return metadata for a TBAA struct node in the type DAG /// with the given name, a list of pairs (offset, field type in the type DAG). MDNode *createTBAAStructTypeNode(StringRef Name, - ArrayRef<std::pair<uint64_t, MDNode*> > Fields) { + ArrayRef<std::pair<MDNode*, uint64_t> > Fields) { SmallVector<Value *, 4> Ops(Fields.size() * 2 + 1); Type *Int64 = IntegerType::get(Context, 64); Ops[0] = createString(Name); for (unsigned i = 0, e = Fields.size(); i != e; ++i) { - Ops[i * 2 + 1] = ConstantInt::get(Int64, Fields[i].first); - Ops[i * 2 + 2] = Fields[i].second; + Ops[i * 2 + 1] = Fields[i].first; + Ops[i * 2 + 2] = ConstantInt::get(Int64, Fields[i].second); } return MDNode::get(Context, Ops); } /// \brief Return metadata for a TBAA scalar type node with the /// given name, an offset and a parent in the TBAA type DAG. - MDNode *createTBAAScalarTypeNode(StringRef Name, uint64_t Offset, - MDNode *Parent) { + MDNode *createTBAAScalarTypeNode(StringRef Name, MDNode *Parent, + uint64_t Offset = 0) { SmallVector<Value *, 4> Ops(3); Type *Int64 = IntegerType::get(Context, 64); Ops[0] = createString(Name); - Ops[1] = ConstantInt::get(Int64, Offset); - Ops[2] = Parent; + Ops[1] = Parent; + Ops[2] = ConstantInt::get(Int64, Offset); return MDNode::get(Context, Ops); } |