summaryrefslogtreecommitdiff
path: root/lib/IR/AttributeImpl.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-28 21:55:20 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-28 21:55:20 +0000
commit87e10dfefa94f77937c37b0eb51095540d675cbc (patch)
treefb23af640a619069bb117ebf009c1803bb97289d /lib/IR/AttributeImpl.h
parentc4e441804ebe5a2d0eadbd9b0840d4f1b12d5a6f (diff)
downloadllvm-87e10dfefa94f77937c37b0eb51095540d675cbc.tar.gz
llvm-87e10dfefa94f77937c37b0eb51095540d675cbc.tar.bz2
llvm-87e10dfefa94f77937c37b0eb51095540d675cbc.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/AttributeImpl.h')
-rw-r--r--lib/IR/AttributeImpl.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h
index 8d5de77eed..457b6ab3e2 100644
--- a/lib/IR/AttributeImpl.h
+++ b/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) {