[cfe-commits] r50396 - /cfe/trunk/lib/Analysis/CFRefCount.cpp
Ted Kremenek
kremenek at apple.com
Mon Apr 28 22:44:10 PDT 2008
Author: kremenek
Date: Tue Apr 29 00:44:10 2008
New Revision: 50396
URL: http://llvm.org/viewvc/llvm-project?rev=50396&view=rev
Log:
Update typestate logic to support GC-mode.
Modified:
cfe/trunk/lib/Analysis/CFRefCount.cpp
Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=50396&r1=50395&r2=50396&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Tue Apr 29 00:44:10 2008
@@ -1288,7 +1288,7 @@
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 @@
break;
case RefVal::Released:
- V = RefVal::makeUseAfterRelease();
- hasErr = V.getKind();
+ if (GCEnabled)
+ V = RefVal::makeOwned();
+ else {
+ V = RefVal::makeUseAfterRelease();
+ hasErr = V.getKind();
+ }
+
break;
}
More information about the cfe-commits
mailing list