Add ImmutableMap methods 'manualRetain()', 'manualRelease()', and 'getRootWithoutReta...
authorTed Kremenek <kremenek@apple.com>
Sat, 19 Feb 2011 01:59:21 +0000 (01:59 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 19 Feb 2011 01:59:21 +0000 (01:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126011 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/ImmutableMap.h

index 7a517b43f8c5474493fb62b3731c1f6f0db9fdcf..e439a099482196cbd79e042d428e4b8509a9cbbd 100644 (file)
@@ -134,11 +134,23 @@ public:
     return Root && RHS.Root ? Root->isNotEqual(*RHS.Root) : Root != RHS.Root;
   }
 
-  TreeTygetRoot() const {
+  TreeTy *getRoot() const {
     if (Root) { Root->retain(); }
     return Root;
   }
 
+  TreeTy *getRootWithoutRetain() const {
+    return Root;
+  }
+  
+  void manualRetain() {
+    if (Root) Root->retain();
+  }
+  
+  void manualRelease() {
+    if (Root) Root->release();
+  }
+
   bool isEmpty() const { return !Root; }
 
   //===--------------------------------------------------===//