aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-08-12 18:48:50 +0000
committerTed Kremenek <kremenek@apple.com>2008-08-12 18:48:50 +0000
commitaf9dc27b1c51d13d444a2ab3a59d8d0798a0f7c6 (patch)
tree218a331947cffee45de3d3def0d71c7930cfda22 /lib/Analysis/CFRefCount.cpp
parent9e476ded1d10802932fc3e2e9d22d30730f22a01 (diff)
More summary generation refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r--lib/Analysis/CFRefCount.cpp44
1 files changed, 23 insertions, 21 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 0c8aa8d481..a5a5b88832 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -557,7 +557,7 @@ class VISIBILITY_HIDDEN RetainSummaryManager {
ObjCMethodSummaries[ObjCSummaryKey(NSPanelII, S)] = Summ;
}
- void addInstMethSummary(RetainSummary* Summ, const char* Cls, va_list argp) {
+ void addInstMethSummary(const char* Cls, RetainSummary* Summ, va_list argp) {
IdentifierInfo* ClsII = &Ctx.Idents.get(Cls);
llvm::SmallVector<IdentifierInfo*, 10> II;
@@ -568,13 +568,20 @@ class VISIBILITY_HIDDEN RetainSummaryManager {
Selector S = Ctx.Selectors.getSelector(II.size(), &II[0]);
ObjCMethodSummaries[ObjCSummaryKey(ClsII, S)] = Summ;
}
+
+ void addInstMethSummary(const char* Cls, RetainSummary* Summ, ...) {
+ va_list argp;
+ va_start(argp, Summ);
+ addInstMethSummary(Cls, Summ, argp);
+ va_end(argp);
+ }
void addPanicSummary(const char* Cls, ...) {
RetainSummary* Summ = getPersistentSummary(0, RetEffect::MakeNoRet(),
DoNothing, DoNothing, true);
va_list argp;
va_start (argp, Cls);
- addInstMethSummary(Summ, Cls, argp);
+ addInstMethSummary(Cls, Summ, argp);
va_end(argp);
}
@@ -1014,29 +1021,24 @@ void RetainSummaryManager::InitializeMethodSummaries() {
Summ = getPersistentSummary(E, isGCEnabled() ? DoNothing : Autorelease);
addNSObjectMethSummary(GetNullarySelector("autorelease", Ctx), Summ);
- // For NSWindow, allocated objects are (initially) self-owned.
+ // For NSWindow, allocated objects are (initially) self-owned.
+ RetainSummary *NSWindowSumm =
+ getPersistentSummary(RetEffect::MakeReceiverAlias(), SelfOwn);
+
+ addInstMethSummary("NSWindow", NSWindowSumm, "initWithContentRect",
+ "styleMask", "backing", "defer", NULL);
+
+ addInstMethSummary("NSWindow", NSWindowSumm, "initWithContentRect",
+ "styleMask", "backing", "defer", "screen", NULL);
+
// For NSPanel (which subclasses NSWindow), allocated objects are not
// self-owned.
+ addInstMethSummary("NSPanel", InitSumm, "initWithContentRect",
+ "styleMask", "backing", "defer", NULL);
- RetainSummary *NSWindowSumm =
- getPersistentSummary(RetEffect::MakeReceiverAlias(), SelfOwn);
+ addInstMethSummary("NSPanel", InitSumm, "initWithContentRect",
+ "styleMask", "backing", "defer", "screen", NULL);
- // Create the "initWithContentRect:styleMask:backing:defer:" selector.
- llvm::SmallVector<IdentifierInfo*, 10> II;
- II.push_back(&Ctx.Idents.get("initWithContentRect"));
- II.push_back(&Ctx.Idents.get("styleMask"));
- II.push_back(&Ctx.Idents.get("backing"));
- II.push_back(&Ctx.Idents.get("defer"));
- Selector S = Ctx.Selectors.getSelector(II.size(), &II[0]);
- addNSWindowMethSummary(S, NSWindowSumm);
- addNSPanelMethSummary(S, InitSumm);
-
- // Create the "initWithContentRect:styleMask:backing:defer:screen:" selector.
- II.push_back(&Ctx.Idents.get("screen"));
- S = Ctx.Selectors.getSelector(II.size(), &II[0]);
- addNSWindowMethSummary(S, NSWindowSumm);
- addNSPanelMethSummary(S, InitSumm);
-
// Create NSAssertionHandler summaries.
addPanicSummary("NSAssertionHandler", "handleFailureInFunction", "file",
"lineNumber", "description", NULL);