[llvm-branch-commits] [cfe-branch] r122858 - in /cfe/branches/Apple/whitney: lib/Sema/SemaExpr.cpp lib/Sema/SemaObjCProperty.cpp test/SemaObjC/provisional-ivar-lookup.m

Daniel Dunbar daniel at zuster.org
Tue Jan 4 18:19:52 PST 2011


Author: ddunbar
Date: Tue Jan  4 20:19:51 2011
New Revision: 122858

URL: http://llvm.org/viewvc/llvm-project?rev=122858&view=rev
Log:
Merge r122757:
--
Author: Fariborz Jahanian <fjahanian at apple.com>
Date:   Mon Jan 3 18:08:02 2011 +0000

    Guard lazy synthesis of provisional ivars under the new
    -fobjc-default-synthesize-properties flag.

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

Modified: cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp?rev=122858&r1=122857&r2=122858&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp Tue Jan  4 20:19:51 2011
@@ -1191,7 +1191,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)) {
@@ -1248,7 +1249,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/branches/Apple/whitney/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Sema/SemaObjCProperty.cpp?rev=122858&r1=122857&r2=122858&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Sema/SemaObjCProperty.cpp Tue Jan  4 20:19:51 2011
@@ -543,7 +543,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/branches/Apple/whitney/test/SemaObjC/provisional-ivar-lookup.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/SemaObjC/provisional-ivar-lookup.m?rev=122858&r1=122857&r2=122858&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/test/SemaObjC/provisional-ivar-lookup.m (original)
+++ cfe/branches/Apple/whitney/test/SemaObjC/provisional-ivar-lookup.m Tue Jan  4 20:19:51 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 llvm-branch-commits mailing list