Skip to content

Commit

Permalink
Add ImmutableMap methods 'manualRetain()', 'manualRelease()', and 'ge…
Browse files Browse the repository at this point in the history
…tRootWithoutRetain()' to help more aggressively reclaim memory in the static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126011 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
tkremenek committed Feb 19, 2011
1 parent 5bc9fec commit 3f912ad
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion include/llvm/ADT/ImmutableMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,23 @@ class ImmutableMap {
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; }

//===--------------------------------------------------===//
Expand Down

0 comments on commit 3f912ad

Please sign in to comment.