summaryrefslogtreecommitdiffstats
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
commita374ea9a351a07cc8ffdf538b29500d07c1353b6 (patch)
tree2c579e2e78c7c58fbf0585011146c295740a1c0d
parent4b7ca776cfb2d3b22d5c45556b1fb6f3881ea7b6 (diff)
downloadbcm5719-llvm-a374ea9a351a07cc8ffdf538b29500d07c1353b6.tar.gz
bcm5719-llvm-a374ea9a351a07cc8ffdf538b29500d07c1353b6.zip
Update typestate logic to support GC-mode.
llvm-svn: 50396
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index 55753f31686..9ed4f1db293 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud