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

Ted Kremenek kremenek at apple.com
Fri Feb 18 17:59:22 PST 2011


Author: kremenek
Date: Fri Feb 18 19:59:21 2011
New Revision: 126011

URL: http://llvm.org/viewvc/llvm-project?rev=126011&view=rev
Log:
Add ImmutableMap methods 'manualRetain()', 'manualRelease()', and 'getRootWithoutRetain()' to help more aggressively reclaim memory in the static analyzer.

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=126011&r1=126010&r2=126011&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableMap.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableMap.h Fri Feb 18 19:59:21 2011
@@ -134,11 +134,23 @@
     return Root && RHS.Root ? Root->isNotEqual(*RHS.Root) : Root != RHS.Root;
   }
 
-  TreeTy* getRoot() 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; }
 
   //===--------------------------------------------------===//





More information about the llvm-commits mailing list