summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-12-19 23:55:43 +0000
committerBill Wendling <isanbard@gmail.com>2012-12-19 23:55:43 +0000
commit6ad6c3b1c24eaca15d56d9a5b4d3ba810a743e33 (patch)
treedb8fa95f9abacdbb2f083ebe6a5b89f6c646ce97 /llvm/lib/VMCore
parent567fcd7da286513e0824b063371b6756f81758b9 (diff)
downloadbcm5719-llvm-6ad6c3b1c24eaca15d56d9a5b4d3ba810a743e33.tar.gz
bcm5719-llvm-6ad6c3b1c24eaca15d56d9a5b4d3ba810a743e33.zip
Add a context so that once we uniquify strings we can access them easily.
llvm-svn: 170615
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/Attributes.cpp2
-rw-r--r--llvm/lib/VMCore/AttributesImpl.h7
2 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/Attributes.cpp b/llvm/lib/VMCore/Attributes.cpp
index 4b975238b25..9e24add8c8d 100644
--- a/llvm/lib/VMCore/Attributes.cpp
+++ b/llvm/lib/VMCore/Attributes.cpp
@@ -382,7 +382,7 @@ AttributeSet AttributeSet::get(LLVMContext &C,
// If we didn't find any existing attributes of the same shape then
// create a new one and insert it.
if (!PA) {
- PA = new AttributeSetImpl(Attrs);
+ PA = new AttributeSetImpl(C, Attrs);
pImpl->AttrsLists.InsertNode(PA, InsertPoint);
}
diff --git a/llvm/lib/VMCore/AttributesImpl.h b/llvm/lib/VMCore/AttributesImpl.h
index 0b3b4971f36..396634ed0fe 100644
--- a/llvm/lib/VMCore/AttributesImpl.h
+++ b/llvm/lib/VMCore/AttributesImpl.h
@@ -20,6 +20,8 @@
namespace llvm {
+class LLVMContext;
+
class AttributesImpl : public FoldingSetNode {
uint64_t Bits; // FIXME: We will be expanding this.
public:
@@ -50,10 +52,11 @@ class AttributeSetImpl : public FoldingSetNode {
void operator=(const AttributeSetImpl &) LLVM_DELETED_FUNCTION;
AttributeSetImpl(const AttributeSetImpl &) LLVM_DELETED_FUNCTION;
public:
+ LLVMContext &Context;
SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeSetImpl(ArrayRef<AttributeWithIndex> attrs)
- : Attrs(attrs.begin(), attrs.end()) {}
+ AttributeSetImpl(LLVMContext &C, ArrayRef<AttributeWithIndex> attrs)
+ : Context(C), Attrs(attrs.begin(), attrs.end()) {}
void Profile(FoldingSetNodeID &ID) const {
Profile(ID, Attrs);
OpenPOWER on IntegriCloud