]> granicus.if.org Git - clang/commitdiff
Guard lazy synthesis of provisional ivars under the new
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 3 Jan 2011 18:08:02 +0000 (18:08 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 3 Jan 2011 18:08:02 +0000 (18:08 +0000)
-fobjc-default-synthesize-properties flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122757 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp
lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/provisional-ivar-lookup.m

index e481e5ce211fb61597dd97367345ac39b6700f60..f0e20496469259241872fb79d4c2042156d27d84 100644 (file)
@@ -1470,7 +1470,8 @@ ExprResult Sema::ActOnIdExpression(Scope *S,
       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 @@ ExprResult Sema::ActOnIdExpression(Scope *S,
 
   if (VarDecl *Var = R.getAsSingle<VarDecl>()) {
     if (getLangOptions().ObjCNonFragileABI && IvarLookupFollowUp &&
-        !getLangOptions().ObjCNonFragileABI2 &&
+        !(getLangOptions().ObjCDefaultSynthProperties && 
+          getLangOptions().ObjCNonFragileABI2) &&
         Var->isFileVarDecl()) {
       ObjCPropertyDecl *Property = canSynthesizeProvisionalIvar(II);
       if (Property) {
index 65a447e2a1a3021a371e08449403bfe3eb8392c3..6aa1c693bc98b22259c9b095f16e059ab15f4940 100644 (file)
@@ -559,7 +559,8 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
       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.
index 526748538e0fe60d1132730e343025c06540d9db..6d57885d61f714bdccaa18f85ad7d5c3e1a4cdc0 100644 (file)
@@ -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  {