diff options
author | Jordy Rose <jediknil@belkadan.com> | 2011-08-24 19:10:50 +0000 |
---|---|---|
committer | Jordy Rose <jediknil@belkadan.com> | 2011-08-24 19:10:50 +0000 |
commit | bd85b1394017cdd75294c75e5bad351a70b2e21c (patch) | |
tree | f9af14140789ccac23620dcf1d9834d3a3bf4937 | |
parent | 0d95f77ba180aee35b74f3bf9f8543477f3af543 (diff) |
[analyzer] Remove unused DoNothingByRef and the special case for CFDictionaryCreate.
This is a very small regression (actually introduced in r138309) because it won't catch leaks of objects passed by reference to CFDictionaryCreate (they're considered to have escaped and are ignored). If this is important we can put in a specific eval::Call to restore the functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138464 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/StaticAnalyzer/Core/CFRefCount.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/StaticAnalyzer/Core/CFRefCount.cpp b/lib/StaticAnalyzer/Core/CFRefCount.cpp index a9d56c5f31..38693a2fa3 100644 --- a/lib/StaticAnalyzer/Core/CFRefCount.cpp +++ b/lib/StaticAnalyzer/Core/CFRefCount.cpp @@ -115,9 +115,9 @@ public: /// ArgEffect is used to summarize a function/method call's effect on a /// particular argument. -enum ArgEffect { Autorelease, Dealloc, DecRef, DecRefMsg, DoNothing, +enum ArgEffect { DoNothing, Autorelease, Dealloc, DecRef, DecRefMsg, DecRefBridgedTransfered, - DoNothingByRef, IncRefMsg, IncRef, MakeCollectable, MayEscape, + IncRefMsg, IncRef, MakeCollectable, MayEscape, NewAutoreleasePool, SelfOwn, StopTracking }; namespace llvm { @@ -612,10 +612,6 @@ class RetainSummaryManager { /// Ctx - The ASTContext object for the analyzed ASTs. ASTContext &Ctx; - /// CFDictionaryCreateII - An IdentifierInfo* representing the indentifier - /// "CFDictionaryCreate". - IdentifierInfo* CFDictionaryCreateII; - /// GCEnabled - Records whether or not the analyzed code runs in GC mode. const bool GCEnabled; @@ -760,7 +756,6 @@ public: RetainSummaryManager(ASTContext &ctx, bool gcenabled, bool usesARC) : Ctx(ctx), - CFDictionaryCreateII(&ctx.Idents.get("CFDictionaryCreate")), GCEnabled(gcenabled), ARCEnabled(usesARC), AF(BPAlloc), ScratchArgs(AF.getEmptyMap()), @@ -1160,11 +1155,6 @@ RetainSummary* RetainSummaryManager::getCFSummaryCreateRule(const FunctionDecl *FD) { assert (ScratchArgs.isEmpty()); - if (FD->getIdentifier() == CFDictionaryCreateII) { - ScratchArgs = AF.add(ScratchArgs, 1, DoNothingByRef); - ScratchArgs = AF.add(ScratchArgs, 2, DoNothingByRef); - } - return getPersistentSummary(RetEffect::MakeOwned(RetEffect::CF, true)); } @@ -3184,7 +3174,6 @@ RetainReleaseChecker::updateSymbol(const ProgramState *state, SymbolRef sym, // Fall-through. - case DoNothingByRef: case DoNothing: return state; |