Small code change to improve performance

in my last patch, suggested by Argyrios.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173182 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Fariborz Jahanian 2013-01-22 19:05:17 +00:00
Родитель 48f3cc2b2b
Коммит 3548068c22
2 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -575,6 +575,9 @@ public:
/// \brief id<NSCopying> type.
QualType QIDNSCopying;
/// \brief will hold 'respondsToSelector:'
Selector RespondsToSelectorSel;
/// A flag to remember whether the implicit forms of operator new and delete
/// have been declared.
bool GlobalNewDeleteDeclared;

Просмотреть файл

@ -2485,8 +2485,12 @@ ExprResult Sema::ActOnInstanceMessage(Scope *S,
MultiExprArg Args) {
if (!Receiver)
return ExprError();
IdentifierInfo *SelectorId = &Context.Idents.get("respondsToSelector");
if (Sel == Context.Selectors.getUnarySelector(SelectorId))
if (RespondsToSelectorSel.isNull()) {
IdentifierInfo *SelectorId = &Context.Idents.get("respondsToSelector");
RespondsToSelectorSel = Context.Selectors.getUnarySelector(SelectorId);
}
if (Sel == RespondsToSelectorSel)
RemoveSelectorFromWarningCache(*this, Args[0]);
return BuildInstanceMessage(Receiver, Receiver->getType(),