OSDN Git Service

* cfgloop.c (verify_loop_structure): Use %' in diagnostics. Start
[pf3gnuchains/gcc-fork.git] / gcc / c-family / c-common.c
index 49eb510..154b6c9 100644 (file)
@@ -439,6 +439,7 @@ const struct c_common_resword c_common_reswords[] =
   { "__is_standard_layout", RID_IS_STD_LAYOUT, D_CXXONLY },
   { "__is_trivial",     RID_IS_TRIVIAL, D_CXXONLY },
   { "__is_union",      RID_IS_UNION,   D_CXXONLY },
+  { "__is_literal_type", RID_IS_LITERAL_TYPE, D_CXXONLY },
   { "__imag",          RID_IMAGPART,   0 },
   { "__imag__",                RID_IMAGPART,   0 },
   { "__inline",                RID_INLINE,     0 },
@@ -543,6 +544,10 @@ const struct c_common_resword c_common_reswords[] =
   { "synchronized",    RID_AT_SYNCHRONIZED,    D_OBJC },
   { "optional",                RID_AT_OPTIONAL,        D_OBJC },
   { "required",                RID_AT_REQUIRED,        D_OBJC },
+  { "property",                RID_AT_PROPERTY,        D_OBJC },
+  { "package",         RID_AT_PACKAGE,         D_OBJC },
+  { "synthesize",      RID_AT_SYNTHESIZE,      D_OBJC },
+  { "dynamic",         RID_AT_DYNAMIC,         D_OBJC },
   /* These are recognized only in protocol-qualifier context
      (see above) */
   { "bycopy",          RID_BYCOPY,             D_OBJC },
@@ -551,6 +556,15 @@ const struct c_common_resword c_common_reswords[] =
   { "inout",           RID_INOUT,              D_OBJC },
   { "oneway",          RID_ONEWAY,             D_OBJC },
   { "out",             RID_OUT,                D_OBJC },
+  /* These are recognized inside a property attribute list */
+  { "assign",          RID_ASSIGN,             D_OBJC }, 
+  { "copy",            RID_COPY,               D_OBJC }, 
+  { "getter",          RID_GETTER,             D_OBJC }, 
+  { "nonatomic",       RID_NONATOMIC,          D_OBJC }, 
+  { "readonly",                RID_READONLY,           D_OBJC }, 
+  { "readwrite",       RID_READWRITE,          D_OBJC }, 
+  { "retain",          RID_RETAIN,             D_OBJC }, 
+  { "setter",          RID_SETTER,             D_OBJC }, 
 };
 
 const unsigned int num_c_common_reswords =
@@ -1849,8 +1863,7 @@ conversion_warning (tree type, tree expr)
   int i;
   const int expr_num_operands = TREE_OPERAND_LENGTH (expr);
   tree expr_type = TREE_TYPE (expr);
-  location_t loc = EXPR_HAS_LOCATION (expr)
-    ? EXPR_LOCATION (expr) : input_location;
+  location_t loc = EXPR_LOC_OR_HERE (expr);
 
   if (!warn_conversion && !warn_sign_conversion)
     return;
@@ -2283,8 +2296,7 @@ warn_for_collisions_1 (tree written, tree writer, struct tlist *list,
          && (!only_writes || list->writer))
        {
          warned_ids = new_tlist (warned_ids, written, NULL_TREE);
-         warning_at (EXPR_HAS_LOCATION (writer)
-                     ? EXPR_LOCATION (writer) : input_location,
+         warning_at (EXPR_LOC_OR_HERE (writer),
                      OPT_Wsequence_point, "operation on %qE may be undefined",
                      list->expr);
        }
@@ -2572,22 +2584,6 @@ check_case_value (tree value)
   if (value == NULL_TREE)
     return value;
 
-  /* ??? Can we ever get nops here for a valid case value?  We
-     shouldn't for C.  */
-  STRIP_TYPE_NOPS (value);
-  /* In C++, the following is allowed:
-
-       const int i = 3;
-       switch (...) { case i: ... }
-
-     So, we try to reduce the VALUE to a constant that way.  */
-  if (c_dialect_cxx ())
-    {
-      value = decl_constant_value (value);
-      STRIP_TYPE_NOPS (value);
-      value = fold (value);
-    }
-
   if (TREE_CODE (value) == INTEGER_CST)
     /* Promote char or short to int.  */
     value = perform_integral_promotions (value);
@@ -5733,7 +5729,8 @@ handle_noreturn_attribute (tree *node, tree name, tree ARG_UNUSED (args),
   tree type = TREE_TYPE (*node);
 
   /* See FIXME comment in c_common_attribute_table.  */
-  if (TREE_CODE (*node) == FUNCTION_DECL)
+  if (TREE_CODE (*node) == FUNCTION_DECL
+      || objc_method_decl (TREE_CODE (*node)))
     TREE_THIS_VOLATILE (*node) = 1;
   else if (TREE_CODE (type) == POINTER_TYPE
           && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
@@ -6411,7 +6408,7 @@ handle_mode_attribute (tree *node, tree name, tree args,
          if (ALL_FIXED_POINT_MODE_P (mode)
              && TYPE_UNSIGNED (type) != UNSIGNED_FIXED_POINT_MODE_P (mode))
            {
-             error ("signness of type and machine mode %qs don't match", p);
+             error ("signedness of type and machine mode %qs don%'t match", p);
              return NULL_TREE;
            }
          /* For fixed-point modes, we need to pass saturating info.  */
@@ -7807,7 +7804,7 @@ parse_optimize_options (tree args, bool attr_p)
                                                &decoded_options,
                                                &decoded_options_count);
   decode_options (&global_options, &global_options_set,
-                 decoded_options, decoded_options_count);
+                 decoded_options, decoded_options_count, global_dc);
 
   targetm.override_options_after_change();
 
@@ -8693,6 +8690,18 @@ complete_array_type (tree *ptype, tree initial_value, bool do_default)
   return failure;
 }
 
+/* Like c_mark_addressable but don't check register qualifier.  */
+void 
+c_common_mark_addressable_vec (tree t)
+{   
+  while (handled_component_p (t))
+    t = TREE_OPERAND (t, 0);
+  if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+    return;
+  TREE_ADDRESSABLE (t) = 1;
+}
+
+
 \f
 /* Used to help initialize the builtin-types.def table.  When a type of
    the correct size doesn't exist, use error_mark_node instead of NULL.