Added ImmutableMap constructor that accepts a const TreeTy*.
authorTed Kremenek <kremenek@apple.com>
Thu, 10 Jul 2008 22:57:10 +0000 (22:57 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 10 Jul 2008 22:57:10 +0000 (22:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53429 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/ImmutableMap.h

index ae2a335942d174002ef021913f4052876df8a7bd..bbf34c566d8bfaa8cff069e8c3e9af7b5c276609 100644 (file)
@@ -76,7 +76,8 @@ public:
   /// should use a Factory object to create maps instead of directly
   /// invoking the constructor, but there are cases where make this
   /// constructor public is useful.
-  explicit ImmutableMap(TreeTy* R) : Root(R) {}
+  explicit ImmutableMap(TreeTy* R) : Root(R) {}  
+  explicit ImmutableMap(const TreeTy* R) : Root(const_cast<TreeTy*>(R)) {}
   
   class Factory {
     typename TreeTy::Factory F;