diff options
author | dim <dim@FreeBSD.org> | 2013-06-10 20:36:52 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-06-10 20:36:52 +0000 |
commit | aa45f148926e3461a1fd8b10c990f0a51a908cc9 (patch) | |
tree | 909310b2e05119d1d6efda049977042abbb58bb1 /include/llvm/IR/MDBuilder.h | |
parent | 169d2bd06003c39970bc94c99669a34b61bb7e45 (diff) | |
download | FreeBSD-src-aa45f148926e3461a1fd8b10c990f0a51a908cc9.zip FreeBSD-src-aa45f148926e3461a1fd8b10c990f0a51a908cc9.tar.gz |
Vendor import of llvm tags/RELEASE_33/final r183502 (effectively, 3.3
release):
http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_33/final@183502
Diffstat (limited to 'include/llvm/IR/MDBuilder.h')
-rw-r--r-- | include/llvm/IR/MDBuilder.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/llvm/IR/MDBuilder.h b/include/llvm/IR/MDBuilder.h index a1e3fb1..ce81b54 100644 --- a/include/llvm/IR/MDBuilder.h +++ b/include/llvm/IR/MDBuilder.h @@ -157,19 +157,31 @@ public: } /// \brief Return metadata for a TBAA struct node in the type DAG - /// with the given name, parents in the TBAA 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, MDNode *Parent, + uint64_t Offset = 0) { + SmallVector<Value *, 4> Ops(3); + Type *Int64 = IntegerType::get(Context, 64); + Ops[0] = createString(Name); + Ops[1] = Parent; + Ops[2] = ConstantInt::get(Int64, Offset); + return MDNode::get(Context, Ops); + } + /// \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, |