summaryrefslogtreecommitdiff
path: root/lib/VMCore/AttributesImpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/AttributesImpl.h')
-rw-r--r--lib/VMCore/AttributesImpl.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/VMCore/AttributesImpl.h b/lib/VMCore/AttributesImpl.h
index b4a0f615f3..5c107e1ebb 100644
--- a/lib/VMCore/AttributesImpl.h
+++ b/lib/VMCore/AttributesImpl.h
@@ -15,12 +15,11 @@
#ifndef LLVM_ATTRIBUTESIMPL_H
#define LLVM_ATTRIBUTESIMPL_H
+#include "llvm/Attributes.h"
#include "llvm/ADT/FoldingSet.h"
namespace llvm {
-class Attributes;
-
class AttributesImpl : public FoldingSetNode {
uint64_t Bits; // FIXME: We will be expanding this.
public:
@@ -46,6 +45,27 @@ public:
}
};
+class AttributeListImpl : public FoldingSetNode {
+ // AttributesList is uniqued, these should not be publicly available.
+ void operator=(const AttributeListImpl &) LLVM_DELETED_FUNCTION;
+ AttributeListImpl(const AttributeListImpl &) LLVM_DELETED_FUNCTION;
+public:
+ SmallVector<AttributeWithIndex, 4> Attrs;
+
+ AttributeListImpl(ArrayRef<AttributeWithIndex> attrs)
+ : Attrs(attrs.begin(), attrs.end()) {}
+
+ void Profile(FoldingSetNodeID &ID) const {
+ Profile(ID, Attrs);
+ }
+ static void Profile(FoldingSetNodeID &ID, ArrayRef<AttributeWithIndex> Attrs){
+ for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
+ ID.AddInteger(Attrs[i].Attrs.Raw());
+ ID.AddInteger(Attrs[i].Index);
+ }
+ }
+};
+
} // end llvm namespace
#endif