[llvm-commits] [llvm] r140402 - /llvm/trunk/include/llvm/ADT/ImmutableMap.h

Anna Zaks ganna at apple.com
Fri Sep 23 12:10:26 PDT 2011


Author: zaks
Date: Fri Sep 23 14:10:26 2011
New Revision: 140402

URL: http://llvm.org/viewvc/llvm-project?rev=140402&view=rev
Log:
Add getTreeFactory() to ImmutableSet to allow construction of ImmutableSetRef from an ImmutableSet object.

Modified:
    llvm/trunk/include/llvm/ADT/ImmutableMap.h

Modified: llvm/trunk/include/llvm/ADT/ImmutableMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableMap.h?rev=140402&r1=140401&r2=140402&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableMap.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableMap.h Fri Sep 23 14:10:26 2011
@@ -117,6 +117,10 @@
       return ImmutableMap(Canonicalize ? F.getCanonicalTree(T): T);
     }
 
+    typename TreeTy::Factory *getTreeFactory() const {
+      return const_cast<typename TreeTy::Factory *>(&F);
+    }
+
   private:
     Factory(const Factory& RHS); // DO NOT IMPLEMENT
     void operator=(const Factory& RHS); // DO NOT IMPLEMENT





More information about the llvm-commits mailing list