[llvm-commits] [llvm] r170615 - in /llvm/trunk/lib/VMCore: Attributes.cpp AttributesImpl.h

Bill Wendling isanbard at gmail.com
Wed Dec 19 15:55:43 PST 2012


Author: void
Date: Wed Dec 19 17:55:43 2012
New Revision: 170615

URL: http://llvm.org/viewvc/llvm-project?rev=170615&view=rev
Log:
Add a context so that once we uniquify strings we can access them easily.

Modified:
    llvm/trunk/lib/VMCore/Attributes.cpp
    llvm/trunk/lib/VMCore/AttributesImpl.h

Modified: llvm/trunk/lib/VMCore/Attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Attributes.cpp?rev=170615&r1=170614&r2=170615&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Attributes.cpp (original)
+++ llvm/trunk/lib/VMCore/Attributes.cpp Wed Dec 19 17:55:43 2012
@@ -382,7 +382,7 @@
   // 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);
   }
 

Modified: llvm/trunk/lib/VMCore/AttributesImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AttributesImpl.h?rev=170615&r1=170614&r2=170615&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AttributesImpl.h (original)
+++ llvm/trunk/lib/VMCore/AttributesImpl.h Wed Dec 19 17:55:43 2012
@@ -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 @@
   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);





More information about the llvm-commits mailing list