aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/IR/AttributeImpl.h15
-rw-r--r--lib/IR/Attributes.cpp5
2 files changed, 14 insertions, 6 deletions
diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h
index b02cc8b..b35e5e0 100644
--- a/lib/IR/AttributeImpl.h
+++ b/lib/IR/AttributeImpl.h
@@ -107,12 +107,17 @@ class AttributeSetImpl : public FoldingSetNode {
LLVMContext &Context;
SmallVector<AttributeWithIndex, 4> AttrList;
+ SmallVector<std::pair<uint64_t, AttributeSetNode*>, 4> AttrNodes;
+
// AttributesSet is uniqued, these should not be publicly available.
void operator=(const AttributeSetImpl &) LLVM_DELETED_FUNCTION;
AttributeSetImpl(const AttributeSetImpl &) LLVM_DELETED_FUNCTION;
public:
AttributeSetImpl(LLVMContext &C, ArrayRef<AttributeWithIndex> attrs)
: Context(C), AttrList(attrs.begin(), attrs.end()) {}
+ AttributeSetImpl(LLVMContext &C,
+ ArrayRef<std::pair<uint64_t, AttributeSetNode*> > attrs)
+ : Context(C), AttrNodes(attrs.begin(), attrs.end()) {}
LLVMContext &getContext() { return Context; }
ArrayRef<AttributeWithIndex> getAttributes() const { return AttrList; }
@@ -122,12 +127,20 @@ public:
Profile(ID, AttrList);
}
static void Profile(FoldingSetNodeID &ID,
- ArrayRef<AttributeWithIndex> AttrList){
+ ArrayRef<AttributeWithIndex> AttrList) {
for (unsigned i = 0, e = AttrList.size(); i != e; ++i) {
ID.AddInteger(AttrList[i].Index);
ID.AddInteger(AttrList[i].Attrs.Raw());
}
}
+
+ static void Profile(FoldingSetNodeID &ID,
+ ArrayRef<std::pair<uint64_t, AttributeSetNode*> > Nodes) {
+ for (unsigned i = 0, e = Nodes.size(); i != e; ++i) {
+ ID.AddInteger(Nodes[i].first);
+ ID.AddPointer(Nodes[i].second);
+ }
+ }
};
} // end llvm namespace
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index 8623b98..8ee7057 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -99,11 +99,6 @@ bool Attribute::operator<(Attribute A) const {
return *pImpl < *A.pImpl;
}
-
-void Attribute::Profile(FoldingSetNodeID &ID) const {
- ID.AddPointer(pImpl);
-}
-
uint64_t Attribute::Raw() const {
return pImpl ? pImpl->Raw() : 0;
}