aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-29 05:44:10 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-29 05:44:10 +0000
commit65c9165dad2ecba22ce1b102aea1c0e6db9914fb (patch)
tree4d91e7a9b52632736dd32d5c29a2c1a88ddf18f3 /lib/Analysis/CFRefCount.cpp
parent377e2306a67f3668bc63fb057a09699cdc7288e6 (diff)
Update typestate logic to support GC-mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50396 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r--lib/Analysis/CFRefCount.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 55753f3168..9ed4f1db29 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -1288,7 +1288,7 @@ CFRefCount::RefBindings CFRefCount::Update(RefBindings B, SymbolID sym,
assert (false && "Unhandled CFRef transition.");
case DoNothing:
- if (V.getKind() == RefVal::Released) {
+ if (!GCEnabled && V.getKind() == RefVal::Released) {
V = RefVal::makeUseAfterRelease();
hasErr = V.getKind();
break;
@@ -1310,8 +1310,13 @@ CFRefCount::RefBindings CFRefCount::Update(RefBindings B, SymbolID sym,
break;
case RefVal::Released:
- V = RefVal::makeUseAfterRelease();
- hasErr = V.getKind();
+ if (GCEnabled)
+ V = RefVal::makeOwned();
+ else {
+ V = RefVal::makeUseAfterRelease();
+ hasErr = V.getKind();
+ }
+
break;
}