r193441 - Minor performance improvement to not do unnecessary work
Fariborz Jahanian
fjahanian at apple.com
Fri Oct 25 15:04:47 PDT 2013
Author: fjahanian
Date: Fri Oct 25 17:04:47 2013
New Revision: 193441
URL: http://llvm.org/viewvc/llvm-project?rev=193441&view=rev
Log:
Minor performance improvement to not do unnecessary work
in my last patch. // rdar://14989999
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=193441&r1=193440&r2=193441&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Oct 25 17:04:47 2013
@@ -2257,12 +2257,14 @@ Sema::LookupInObjCMethod(LookupResult &L
return ExprError();
MarkAnyDeclReferenced(Loc, IV, true);
- // Mark this ivar 'referenced' in this method, if it is a backing ivar
- // of a property and current method is one of its property accessor.
- const ObjCPropertyDecl *PDecl;
- const ObjCIvarDecl *BIV = GetIvarBackingPropertyAccessor(CurMethod, PDecl);
- if (BIV && BIV == IV)
- IV->setBackingIvarReferencedInAccessor(true);
+ if (!IV->getBackingIvarReferencedInAccessor()) {
+ // Mark this ivar 'referenced' in this method, if it is a backing ivar
+ // of a property and current method is one of its property accessor.
+ const ObjCPropertyDecl *PDecl;
+ const ObjCIvarDecl *BIV = GetIvarBackingPropertyAccessor(CurMethod, PDecl);
+ if (BIV && BIV == IV)
+ IV->setBackingIvarReferencedInAccessor(true);
+ }
ObjCMethodFamily MF = CurMethod->getMethodFamily();
if (MF != OMF_init && MF != OMF_dealloc && MF != OMF_finalize &&
More information about the cfe-commits
mailing list