[cfe-commits] r122757 - in /cfe/trunk: lib/Sema/SemaExpr.cpp lib/Sema/SemaObjCProperty.cpp test/SemaObjC/provisional-ivar-lookup.m

Fariborz Jahanian fjahanian at apple.com
Mon Jan 3 10:08:02 PST 2011


Author: fjahanian
Date: Mon Jan  3 12:08:02 2011
New Revision: 122757

URL: http://llvm.org/viewvc/llvm-project?rev=122757&view=rev
Log:
Guard lazy synthesis of provisional ivars under the new
-fobjc-default-synthesize-properties flag.


Modified:
    cfe/trunk/lib/Sema/SemaExpr.cpp
    cfe/trunk/lib/Sema/SemaObjCProperty.cpp
    cfe/trunk/test/SemaObjC/provisional-ivar-lookup.m

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=122757&r1=122756&r2=122757&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Jan  3 12:08:02 2011
@@ -1470,7 +1470,8 @@
       Expr *Ex = E.takeAs<Expr>();
       if (Ex) return Owned(Ex);
       // Synthesize ivars lazily
-      if (getLangOptions().ObjCNonFragileABI2) {
+      if (getLangOptions().ObjCDefaultSynthProperties &&
+          getLangOptions().ObjCNonFragileABI2) {
         if (SynthesizeProvisionalIvar(*this, R, II, NameLoc)) {
           if (const ObjCPropertyDecl *Property = 
                 canSynthesizeProvisionalIvar(II)) {
@@ -1527,7 +1528,8 @@
 
   if (VarDecl *Var = R.getAsSingle<VarDecl>()) {
     if (getLangOptions().ObjCNonFragileABI && IvarLookupFollowUp &&
-        !getLangOptions().ObjCNonFragileABI2 &&
+        !(getLangOptions().ObjCDefaultSynthProperties && 
+          getLangOptions().ObjCNonFragileABI2) &&
         Var->isFileVarDecl()) {
       ObjCPropertyDecl *Property = canSynthesizeProvisionalIvar(II);
       if (Property) {

Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=122757&r1=122756&r2=122757&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Mon Jan  3 12:08:02 2011
@@ -559,7 +559,8 @@
       return 0;
     }
     IC->addPropertyImplementation(PIDecl);
-    if (getLangOptions().ObjCNonFragileABI2) {
+    if (getLangOptions().ObjCDefaultSynthProperties &&
+        getLangOptions().ObjCNonFragileABI2) {
       // Diagnose if an ivar was lazily synthesdized due to a previous
       // use and if 1) property is @dynamic or 2) property is synthesized
       // but it requires an ivar of different name.

Modified: cfe/trunk/test/SemaObjC/provisional-ivar-lookup.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/provisional-ivar-lookup.m?rev=122757&r1=122756&r2=122757&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/provisional-ivar-lookup.m (original)
+++ cfe/trunk/test/SemaObjC/provisional-ivar-lookup.m Mon Jan  3 12:08:02 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1  -fsyntax-only -fobjc-nonfragile-abi2 -verify %s
+// RUN: %clang_cc1  -fsyntax-only -fobjc-default-synthesize-properties -fobjc-nonfragile-abi2 -verify %s
 
 // rdar:// 8565343
 @interface Foo  {





More information about the cfe-commits mailing list