Minor refactoring: pass selector to getCommonMethodSummary(). No functionality
change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69985 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 1021574..7b16007 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -721,7 +721,7 @@
RetainSummary* getSummary(FunctionDecl* FD);
RetainSummary* getMethodSummary(ObjCMessageExpr* ME, ObjCInterfaceDecl* ID);
RetainSummary* getClassMethodSummary(ObjCMessageExpr *ME);
- RetainSummary* getCommonMethodSummary(ObjCMessageExpr *ME, const char *s);
+ RetainSummary* getCommonMethodSummary(ObjCMessageExpr *ME, Selector S);
bool isGCEnabled() const { return GCEnabled; }
};
@@ -1074,7 +1074,7 @@
RetainSummary*
-RetainSummaryManager::getCommonMethodSummary(ObjCMessageExpr* ME, const char *s)
+RetainSummaryManager::getCommonMethodSummary(ObjCMessageExpr* ME, Selector S)
{
if (ObjCMethodDecl *MD = ME->getMethodDecl()) {
// Scan the method decl for 'void*' arguments. These should be treated
@@ -1103,7 +1103,7 @@
// by instance methods.
RetEffect E =
- followsFundamentalRule(s)
+ followsFundamentalRule(S.getIdentifierInfoForSlot(0)->getName())
? (isGCEnabled() ? RetEffect::MakeNotOwned(RetEffect::ObjC)
: RetEffect::MakeOwned(RetEffect::ObjC, true))
: RetEffect::MakeNotOwned(RetEffect::ObjC);
@@ -1124,13 +1124,13 @@
return I->second;
// "initXXX": pass-through for receiver.
- const char* s = S.getIdentifierInfoForSlot(0)->getName();
assert(ScratchArgs.empty());
- if (deriveNamingConvention(s) == InitRule)
+ if (deriveNamingConvention(S.getIdentifierInfoForSlot(0)->getName())
+ == InitRule)
return getInitMethodSummary(ME);
- RetainSummary *Summ = getCommonMethodSummary(ME, s);
+ RetainSummary *Summ = getCommonMethodSummary(ME, S);
ObjCMethodSummaries[ME] = Summ;
return Summ;
}
@@ -1156,9 +1156,7 @@
if (I != ObjCClassMethodSummaries.end())
return I->second;
- RetainSummary* Summ =
- getCommonMethodSummary(ME, S.getIdentifierInfoForSlot(0)->getName());
-
+ RetainSummary* Summ = getCommonMethodSummary(ME, S);
ObjCClassMethodSummaries[ObjCSummaryKey(ME->getClassName(), S)] = Summ;
return Summ;
}