diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-28 21:55:20 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-28 21:55:20 +0000 |
commit | ec454546ecc78d3c60e7395b5fbdb0c6b74c6fc9 (patch) | |
tree | 78c3c43aebfd5267b06b1b092a294ef54e6fe5f8 /llvm/lib/IR/AttributeImpl.h | |
parent | 00830962c6d4aa4d2520e0179e9cf182e8013b59 (diff) | |
download | bcm5719-llvm-ec454546ecc78d3c60e7395b5fbdb0c6b74c6fc9.tar.gz bcm5719-llvm-ec454546ecc78d3c60e7395b5fbdb0c6b74c6fc9.zip |
Remove the AttributeWithIndex class.
The AttributeWithIndex class exposed the interior structure of the AttributeSet
class. That was gross. Remove it and all of the code that relied upon it.
llvm-svn: 173722
Diffstat (limited to 'llvm/lib/IR/AttributeImpl.h')
-rw-r--r-- | llvm/lib/IR/AttributeImpl.h | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/llvm/lib/IR/AttributeImpl.h b/llvm/lib/IR/AttributeImpl.h index 8d5de77eed1..457b6ab3e21 100644 --- a/llvm/lib/IR/AttributeImpl.h +++ b/llvm/lib/IR/AttributeImpl.h @@ -115,7 +115,6 @@ class AttributeSetImpl : public FoldingSetNode { friend class AttributeSet; LLVMContext &Context; - SmallVector<AttributeWithIndex, 4> AttrList; typedef std::pair<uint64_t, AttributeSetNode*> IndexAttrPair; SmallVector<IndexAttrPair, 4> AttrNodes; @@ -124,13 +123,13 @@ class AttributeSetImpl : public FoldingSetNode { void operator=(const AttributeSetImpl &) LLVM_DELETED_FUNCTION; AttributeSetImpl(const AttributeSetImpl &) LLVM_DELETED_FUNCTION; public: - AttributeSetImpl(LLVMContext &C, ArrayRef<AttributeWithIndex> attrs); + AttributeSetImpl(LLVMContext &C, + ArrayRef<std::pair<uint64_t, AttributeSetNode*> > attrs) + : Context(C), AttrNodes(attrs.begin(), attrs.end()) {} /// \brief Get the context that created this AttributeSetImpl. LLVMContext &getContext() { return Context; } - ArrayRef<AttributeWithIndex> getAttributes() const { return AttrList; } - /// \brief Return the number of attributes this AttributeSet contains. unsigned getNumAttributes() const { return AttrNodes.size(); } @@ -147,7 +146,7 @@ public: /// parameter/ function which the attributes apply to. AttributeSet getSlotAttributes(unsigned Slot) const { // FIXME: This needs to use AttrNodes instead. - return AttributeSet::get(Context, AttrList[Slot]); + return AttributeSet::get(Context, AttrNodes[Slot]); } typedef AttributeSetNode::iterator iterator; @@ -164,16 +163,8 @@ public: { return AttrNodes[Idx].second->end(); } void Profile(FoldingSetNodeID &ID) const { - Profile(ID, AttrList); - } - static void Profile(FoldingSetNodeID &ID, - ArrayRef<AttributeWithIndex> AttrList) { - for (unsigned i = 0, e = AttrList.size(); i != e; ++i) { - ID.AddInteger(AttrList[i].Index); - ID.AddInteger(AttrList[i].Attrs.Raw()); - } + Profile(ID, AttrNodes); } - static void Profile(FoldingSetNodeID &ID, ArrayRef<std::pair<uint64_t, AttributeSetNode*> > Nodes) { for (unsigned i = 0, e = Nodes.size(); i != e; ++i) { |