From b3e3b006bd5c82516d6fdb487d5c1263a5249474 Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Fri, 23 Sep 2011 19:10:26 +0000 Subject: [PATCH] Add getTreeFactory() to ImmutableSet to allow construction of ImmutableSetRef from an ImmutableSet object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140402 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/ImmutableMap.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/llvm/ADT/ImmutableMap.h b/include/llvm/ADT/ImmutableMap.h index 7386a3b9a1e..8346ffabff7 100644 --- a/include/llvm/ADT/ImmutableMap.h +++ b/include/llvm/ADT/ImmutableMap.h @@ -117,6 +117,10 @@ public: return ImmutableMap(Canonicalize ? F.getCanonicalTree(T): T); } + typename TreeTy::Factory *getTreeFactory() const { + return const_cast(&F); + } + private: Factory(const Factory& RHS); // DO NOT IMPLEMENT void operator=(const Factory& RHS); // DO NOT IMPLEMENT