[cfe-commits] r147622 - in /cfe/trunk: include/clang/AST/DeclObjC.h include/clang/Basic/Attr.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/AttributeList.h lib/Sema/AttributeList.cpp lib/Sema/SemaDeclAttr.cpp lib/Sema/SemaDeclObjC.cpp lib/Sema/SemaObjCProperty.cpp test/SemaObjC/default-synthesize-3.m

Ted Kremenek kremenek at apple.com
Thu Jan 5 14:47:48 PST 2012


Author: kremenek
Date: Thu Jan  5 16:47:47 2012
New Revision: 147622

URL: http://llvm.org/viewvc/llvm-project?rev=147622&view=rev
Log:
After further discussion, rename attribute 'objc_disable_automatic_synthesis' to 'objc_requires_property_definitions'.

Modified:
    cfe/trunk/include/clang/AST/DeclObjC.h
    cfe/trunk/include/clang/Basic/Attr.td
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/include/clang/Sema/AttributeList.h
    cfe/trunk/lib/Sema/AttributeList.cpp
    cfe/trunk/lib/Sema/SemaDeclAttr.cpp
    cfe/trunk/lib/Sema/SemaDeclObjC.cpp
    cfe/trunk/lib/Sema/SemaObjCProperty.cpp
    cfe/trunk/test/SemaObjC/default-synthesize-3.m

Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=147622&r1=147621&r2=147622&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Thu Jan  5 16:47:47 2012
@@ -866,13 +866,13 @@
    return false;
   }
 
-  /// isObjCSuppressAutosynthesis - Checks that a class or one of its super 
+  /// isObjCRequiresPropertyDefs - Checks that a class or one of its super 
   /// classes must not be auto-synthesized. Returns class decl. if it must not be;
   /// 0, otherwise.
-  const ObjCInterfaceDecl *isObjCSuppressAutosynthesis() const {
+  const ObjCInterfaceDecl *isObjCRequiresPropertyDefs() const {
     const ObjCInterfaceDecl *Class = this;
     while (Class) {
-      if (Class->hasAttr<ObjCSuppressAutosynthesisAttr>())
+      if (Class->hasAttr<ObjCRequiresPropertyDefsAttr>())
         return Class;
       Class = Class->getSuperClass();
    }

Modified: cfe/trunk/include/clang/Basic/Attr.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=147622&r1=147621&r2=147622&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Attr.td (original)
+++ cfe/trunk/include/clang/Basic/Attr.td Thu Jan  5 16:47:47 2012
@@ -524,8 +524,8 @@
   let Spellings = ["objc_arc_weak_reference_unavailable"];
 }
 
-def ObjCSuppressAutosynthesis : InheritableAttr {
-  let Spellings = ["objc_disable_automatic_synthesis"];
+def ObjCRequiresPropertyDefs : InheritableAttr {
+  let Spellings = ["objc_requires_property_definitions"];
 }
 
 def Unused : InheritableAttr {

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=147622&r1=147621&r2=147622&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Jan  5 16:47:47 2012
@@ -380,7 +380,7 @@
 def note_class_declared : Note<
   "class is declared here">;
 def note_suppressed_class_declare : Note<
-  "class with specified objc_disable_automatic_synthesis attribute is declared here">;
+  "class with specified objc_requires_property_definitions attribute is declared here">;
 def warn_dup_category_def : Warning<
   "duplicate definition of category %1 on interface %0">;
 def err_conflicting_super_class : Error<"conflicting super class name %0">;
@@ -1374,7 +1374,7 @@
 def err_attribute_too_many_arguments : Error<
   "attribute takes no more than %0 argument%s0">;
 def err_suppress_autosynthesis : Error<
-  "objc_disable_automatic_synthesis attribute may only be specified on a class"
+  "objc_requires_property_definitions attribute may only be specified on a class"
   "to a class declaration">;
 def err_attribute_too_few_arguments : Error<
   "attribute takes at least %0 argument%s0">;

Modified: cfe/trunk/include/clang/Sema/AttributeList.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/AttributeList.h?rev=147622&r1=147621&r2=147622&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/AttributeList.h (original)
+++ cfe/trunk/include/clang/Sema/AttributeList.h Thu Jan  5 16:47:47 2012
@@ -169,7 +169,7 @@
     AT_analyzer_noreturn,
     AT_annotate,
     AT_arc_weakref_unavailable,
-    AT_objc_disable_automatic_synthesis,
+    AT_objc_requires_property_definitions,
     AT_availability,      // Clang-specific
     AT_base_check,
     AT_blocks,

Modified: cfe/trunk/lib/Sema/AttributeList.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AttributeList.cpp?rev=147622&r1=147621&r2=147622&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AttributeList.cpp (original)
+++ cfe/trunk/lib/Sema/AttributeList.cpp Thu Jan  5 16:47:47 2012
@@ -108,7 +108,7 @@
     .Case("weak", AT_weak)
     .Case("weakref", AT_weakref)
     .Case("objc_arc_weak_reference_unavailable", AT_arc_weakref_unavailable)
-    .Case("objc_disable_automatic_synthesis", AT_objc_disable_automatic_synthesis)
+    .Case("objc_requires_property_definitions", AT_objc_requires_property_definitions)
     .Case("pure", AT_pure)
     .Case("mode", AT_mode)
     .Case("used", AT_used)

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=147622&r1=147621&r2=147622&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Thu Jan  5 16:47:47 2012
@@ -1579,7 +1579,7 @@
                                           Attr.getRange(), S.Context));
 }
 
-static void handleObjCSuppressAutosynthesisAttr(Sema &S, Decl *D, 
+static void handleObjCRequiresPropertyDefsAttr(Sema &S, Decl *D, 
                                             const AttributeList &Attr) {
   if (!isa<ObjCInterfaceDecl>(D)) {
     S.Diag(Attr.getLoc(), diag::err_suppress_autosynthesis);
@@ -1592,7 +1592,7 @@
     return;
   }
   
-  D->addAttr(::new (S.Context) ObjCSuppressAutosynthesisAttr(
+  D->addAttr(::new (S.Context) ObjCRequiresPropertyDefsAttr(
                                  Attr.getRange(), S.Context));
 }
 
@@ -3620,8 +3620,8 @@
   case AttributeList::AT_arc_weakref_unavailable: 
     handleArcWeakrefUnavailableAttr (S, D, Attr); 
     break;
-  case AttributeList::AT_objc_disable_automatic_synthesis: 
-    handleObjCSuppressAutosynthesisAttr (S, D, Attr); 
+  case AttributeList::AT_objc_requires_property_definitions: 
+    handleObjCRequiresPropertyDefsAttr (S, D, Attr); 
     break;
   case AttributeList::AT_unused:      handleUnusedAttr      (S, D, Attr); break;
   case AttributeList::AT_returns_twice:

Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=147622&r1=147621&r2=147622&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Jan  5 16:47:47 2012
@@ -1667,7 +1667,7 @@
   // of the property in the @implementation.
   if (const ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(CDecl))
     if  (!(LangOpts.ObjCDefaultSynthProperties && LangOpts.ObjCNonFragileABI2) ||
-      IDecl->isObjCSuppressAutosynthesis())
+      IDecl->isObjCRequiresPropertyDefs())
       DiagnoseUnimplementedProperties(S, IMPDecl, CDecl, InsMap);
       
   llvm::DenseSet<Selector> ClsMap;

Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=147622&r1=147621&r2=147622&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Thu Jan  5 16:47:47 2012
@@ -857,7 +857,7 @@
     IC->addPropertyImplementation(PIDecl);
     if (getLangOptions().ObjCDefaultSynthProperties &&
         getLangOptions().ObjCNonFragileABI2 &&
-        !IDecl->isObjCSuppressAutosynthesis()) {
+        !IDecl->isObjCRequiresPropertyDefs()) {
       // 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.
@@ -1356,7 +1356,7 @@
   if (!IC)
     return;
   if (ObjCInterfaceDecl* IDecl = IC->getClassInterface())
-    if (!IDecl->isObjCSuppressAutosynthesis())
+    if (!IDecl->isObjCRequiresPropertyDefs())
       DefaultSynthesizeProperties(S, IC, IDecl);
 }
 
@@ -1396,7 +1396,7 @@
            diag::note_property_declare);
       if (LangOpts.ObjCDefaultSynthProperties && LangOpts.ObjCNonFragileABI2)
         if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(CDecl))
-          if (const ObjCInterfaceDecl *RID = ID->isObjCSuppressAutosynthesis())
+          if (const ObjCInterfaceDecl *RID = ID->isObjCRequiresPropertyDefs())
             Diag(RID->getLocation(), diag::note_suppressed_class_declare);
             
     }
@@ -1411,7 +1411,7 @@
            diag::note_property_declare);
       if (LangOpts.ObjCDefaultSynthProperties && LangOpts.ObjCNonFragileABI2)
         if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(CDecl))
-          if (const ObjCInterfaceDecl *RID = ID->isObjCSuppressAutosynthesis())
+          if (const ObjCInterfaceDecl *RID = ID->isObjCRequiresPropertyDefs())
             Diag(RID->getLocation(), diag::note_suppressed_class_declare);
     }
   }

Modified: cfe/trunk/test/SemaObjC/default-synthesize-3.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/default-synthesize-3.m?rev=147622&r1=147621&r2=147622&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/default-synthesize-3.m (original)
+++ cfe/trunk/test/SemaObjC/default-synthesize-3.m Thu Jan  5 16:47:47 2012
@@ -1,10 +1,10 @@
 // RUN: %clang_cc1 -x objective-c -fsyntax-only -fobjc-default-synthesize-properties -verify %s
 // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-default-synthesize-properties -verify %s
 
-#if __has_attribute(objc_disable_automatic_synthesis)
-__attribute ((objc_disable_automatic_synthesis)) 
+#if __has_attribute(objc_requires_property_definitions)
+__attribute ((objc_requires_property_definitions)) 
 #endif
- at interface NoAuto // expected-note 2 {{class with specified objc_disable_automatic_synthesis attribute is declared here}}
+ at interface NoAuto // expected-note 2 {{class with specified objc_requires_property_definitions attribute is declared here}}
 @property int NoAutoProp; // expected-note 2 {{property declared here}}
 @end
 
@@ -12,8 +12,8 @@
                         // expected-warning {{property 'NoAutoProp' requires method 'setNoAutoProp:'}}
 @end
 
-__attribute ((objc_disable_automatic_synthesis))  // redundant, just for testing
- at interface Sub : NoAuto  // expected-note 3 {{class with specified objc_disable_automatic_synthesis attribute is declared here}}
+__attribute ((objc_requires_property_definitions))  // redundant, just for testing
+ at interface Sub : NoAuto  // expected-note 3 {{class with specified objc_requires_property_definitions attribute is declared here}}
 @property (copy) id SubProperty; // expected-note 2 {{property declared here}}
 @end
 
@@ -33,9 +33,9 @@
 - (id) DeepMustSynthProperty { return 0; }
 @end
 
-__attribute ((objc_disable_automatic_synthesis)) 
+__attribute ((objc_requires_property_definitions)) 
 @interface Deep(CAT)  // expected-error {{attributes may not be specified on a category}}
 @end
 
-__attribute ((objc_disable_automatic_synthesis)) // expected-error {{objc_disable_automatic_synthesis attribute may only be specified on a class}} 
+__attribute ((objc_requires_property_definitions)) // expected-error {{objc_requires_property_definitions attribute may only be specified on a class}} 
 @protocol P @end





More information about the cfe-commits mailing list