aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc/objc-act.c
diff options
context:
space:
mode:
authorMike Stump <mrs@gcc.gnu.org>2011-05-04 18:25:20 +0000
committerMike Stump <mrs@gcc.gnu.org>2011-05-04 18:25:20 +0000
commit944fb7998bc4f4d47fa84fda494421da7669d085 (patch)
tree07d97f3d016f0540978a7cd2ab6948ce8a11c34c /gcc/objc/objc-act.c
parent42375e2ea3a9043cd0e397b380b35bebf1315202 (diff)
downloadgcc-944fb7998bc4f4d47fa84fda494421da7669d085.zip
gcc-944fb7998bc4f4d47fa84fda494421da7669d085.tar.gz
gcc-944fb7998bc4f4d47fa84fda494421da7669d085.tar.bz2
Fixup whitespacing.
From-SVN: r173388
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r--gcc/objc/objc-act.c654
1 files changed, 327 insertions, 327 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 250b317..025f375 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -163,7 +163,7 @@ static void objc_generate_cxx_cdtors (void);
#endif
/* objc attribute */
-static void objc_decl_method_attributes (tree*, tree, int);
+static void objc_decl_method_attributes (tree*, tree, int);
static tree build_keyword_selector (tree);
/* Hash tables to manage the global pool of method prototypes. */
@@ -232,7 +232,7 @@ static tree check_duplicates (hash, int, int);
#define OBJC_LOOKUP_NO_SUPER 2
/* Disable returning an instance method of a root class when a class
method can't be found. */
-#define OBJC_LOOKUP_NO_INSTANCE_METHODS_OF_ROOT_CLASS 4
+#define OBJC_LOOKUP_NO_INSTANCE_METHODS_OF_ROOT_CLASS 4
/* The OCTI_... enumeration itself is in objc/objc-act.h. */
tree objc_global_trees[OCTI_MAX];
@@ -458,7 +458,7 @@ objc_write_global_declarations (void)
/* TODO: consider an early exit here if either errorcount or sorrycount
is non-zero. Not only is it wasting time to generate the metadata,
- it needlessly imposes need to re-check for things that are already
+ it needlessly imposes need to re-check for things that are already
determined to be errors. */
/* Finalize Objective-C runtime data. No need to generate tables
@@ -590,7 +590,7 @@ objc_start_class_interface (tree klass, tree super_class,
tree protos, tree attributes)
{
if (flag_objc1_only && attributes)
- error_at (input_location, "class attributes are not available in Objective-C 1.0");
+ error_at (input_location, "class attributes are not available in Objective-C 1.0");
objc_interface_context
= objc_ivar_context
@@ -607,7 +607,7 @@ objc_start_category_interface (tree klass, tree categ,
if (flag_objc1_only)
error_at (input_location, "category attributes are not available in Objective-C 1.0");
else
- warning_at (input_location, OPT_Wattributes,
+ warning_at (input_location, OPT_Wattributes,
"category attributes are not available in this version"
" of the compiler, (ignored)");
}
@@ -627,7 +627,7 @@ objc_start_category_interface (tree klass, tree categ,
as the one we are extending, produce an error. */
if (TREE_CODE (t->imp_context) == CLASS_IMPLEMENTATION_TYPE
&& IDENTIFIER_POINTER (CLASS_NAME (t->imp_context)) == IDENTIFIER_POINTER (klass))
- error_at (input_location,
+ error_at (input_location,
"class extension for class %qE declared after its %<@implementation%>",
klass);
}
@@ -643,7 +643,7 @@ void
objc_start_protocol (tree name, tree protos, tree attributes)
{
if (flag_objc1_only && attributes)
- error_at (input_location, "protocol attributes are not available in Objective-C 1.0");
+ error_at (input_location, "protocol attributes are not available in Objective-C 1.0");
objc_interface_context
= start_protocol (PROTOCOL_INTERFACE_TYPE, name, protos, attributes);
@@ -730,13 +730,13 @@ objc_set_method_opt (bool optional)
if (flag_objc1_only)
{
if (optional)
- error_at (input_location, "%<@optional%> is not available in Objective-C 1.0");
+ error_at (input_location, "%<@optional%> is not available in Objective-C 1.0");
else
- error_at (input_location, "%<@required%> is not available in Objective-C 1.0");
+ error_at (input_location, "%<@required%> is not available in Objective-C 1.0");
}
objc_method_optional_flag = optional;
- if (!objc_interface_context
+ if (!objc_interface_context
|| TREE_CODE (objc_interface_context) != PROTOCOL_INTERFACE_TYPE)
{
if (optional)
@@ -808,11 +808,11 @@ lookup_property (tree interface_type, tree property)
}
/* Failing to find in categories, look for property in protocol list. */
- if (CLASS_PROTOCOL_LIST (inter)
+ if (CLASS_PROTOCOL_LIST (inter)
&& (x = lookup_property_in_protocol_list
(CLASS_PROTOCOL_LIST (inter), property)))
return x;
-
+
/* Failing that, climb up the inheritance hierarchy. */
inter = lookup_interface (CLASS_SUPER_NAME (inter));
}
@@ -863,7 +863,7 @@ objc_add_property_declaration (location_t location, tree decl,
{
if (parsed_property_readonly)
property_readonly = true;
-
+
if (parsed_property_readwrite)
property_readonly = false;
}
@@ -915,7 +915,7 @@ objc_add_property_declaration (location_t location, tree decl,
if (TREE_CODE (decl) != FIELD_DECL)
{
error_at (location, "invalid property declaration");
- return;
+ return;
}
/* Do some spot-checks for the most obvious invalid types. */
@@ -941,7 +941,7 @@ objc_add_property_declaration (location_t location, tree decl,
underlying instance variable could be a bitfield, but that is
a different matter. */
error_at (location, "property can not be a bit-field");
- return;
+ return;
}
#endif
@@ -970,20 +970,20 @@ objc_add_property_declaration (location_t location, tree decl,
/* Use 'false' so we do not warn for Class objects. */
if (objc_type_valid_for_messaging (TREE_TYPE (decl), false))
{
- warning_at (location,
+ warning_at (location,
0,
- "object property %qD has no %<assign%>, %<retain%> or %<copy%> attribute; assuming %<assign%>",
+ "object property %qD has no %<assign%>, %<retain%> or %<copy%> attribute; assuming %<assign%>",
decl);
- inform (location,
+ inform (location,
"%<assign%> can be unsafe for Objective-C objects; please state explicitly if you need it");
}
}
}
-
+
if (property_assign_semantics == OBJC_PROPERTY_RETAIN
&& !objc_type_valid_for_messaging (TREE_TYPE (decl), true))
error_at (location, "%<retain%> attribute is only valid for Objective-C objects");
-
+
if (property_assign_semantics == OBJC_PROPERTY_COPY
&& !objc_type_valid_for_messaging (TREE_TYPE (decl), true))
error_at (location, "%<copy%> attribute is only valid for Objective-C objects");
@@ -1011,7 +1011,7 @@ objc_add_property_declaration (location_t location, tree decl,
else
{
if (!property_readonly)
- parsed_property_setter_ident = get_identifier (objc_build_property_setter_name
+ parsed_property_setter_ident = get_identifier (objc_build_property_setter_name
(DECL_NAME (decl)));
}
@@ -1039,9 +1039,9 @@ objc_add_property_declaration (location_t location, tree decl,
else
{
location_t original_location = DECL_SOURCE_LOCATION (x);
-
+
error_at (location, "redeclaration of property %qD", decl);
-
+
if (original_location != UNKNOWN_LOCATION)
inform (original_location, "originally specified here");
return;
@@ -1106,7 +1106,7 @@ objc_add_property_declaration (location_t location, tree decl,
{
warning_at (location, 0,
"'nonatomic' attribute of property %qD conflicts with previous declaration", decl);
-
+
if (original_location != UNKNOWN_LOCATION)
inform (original_location, "originally specified here");
return;
@@ -1116,7 +1116,7 @@ objc_add_property_declaration (location_t location, tree decl,
{
warning_at (location, 0,
"'getter' attribute of property %qD conflicts with previous declaration", decl);
-
+
if (original_location != UNKNOWN_LOCATION)
inform (original_location, "originally specified here");
return;
@@ -1129,7 +1129,7 @@ objc_add_property_declaration (location_t location, tree decl,
{
warning_at (location, 0,
"'setter' attribute of property %qD conflicts with previous declaration", decl);
-
+
if (original_location != UNKNOWN_LOCATION)
inform (original_location, "originally specified here");
return;
@@ -1140,7 +1140,7 @@ objc_add_property_declaration (location_t location, tree decl,
{
warning_at (location, 0,
"assign semantics attributes of property %qD conflict with previous declaration", decl);
-
+
if (original_location != UNKNOWN_LOCATION)
inform (original_location, "originally specified here");
return;
@@ -1151,7 +1151,7 @@ objc_add_property_declaration (location_t location, tree decl,
{
warning_at (location, 0,
"'readonly' attribute of property %qD conflicts with previous declaration", decl);
-
+
if (original_location != UNKNOWN_LOCATION)
inform (original_location, "originally specified here");
return;
@@ -1183,7 +1183,7 @@ objc_add_property_declaration (location_t location, tree decl,
if (!comptypes (TREE_TYPE (x), TREE_TYPE (decl))
/* ... unless the property is readonly, in which case we
allow a new, more specialized, declaration. */
- && (!property_readonly
+ && (!property_readonly
|| !objc_compare_types (TREE_TYPE (x),
TREE_TYPE (decl), -5, NULL_TREE)))
{
@@ -1213,7 +1213,7 @@ objc_add_property_declaration (location_t location, tree decl,
TREE_TYPE (property_decl) = TREE_TYPE (decl);
DECL_SOURCE_LOCATION (property_decl) = DECL_SOURCE_LOCATION (decl);
TREE_DEPRECATED (property_decl) = TREE_DEPRECATED (decl);
-
+
/* Add property-specific information. */
PROPERTY_NAME (property_decl) = DECL_NAME (decl);
PROPERTY_GETTER_NAME (property_decl) = parsed_property_getter_ident;
@@ -1253,7 +1253,7 @@ objc_add_property_declaration (location_t location, tree decl,
any is found, then create an artificial property that uses them.
Return NULL_TREE if 'getter' or 'setter' could not be found. */
static tree
-maybe_make_artificial_property_decl (tree interface, tree implementation,
+maybe_make_artificial_property_decl (tree interface, tree implementation,
tree protocol_list, tree component, bool is_class,
tree getter_name)
{
@@ -1275,7 +1275,7 @@ maybe_make_artificial_property_decl (tree interface, tree implementation,
Turn it off. */
if (is_class)
flags = OBJC_LOOKUP_CLASS | OBJC_LOOKUP_NO_INSTANCE_METHODS_OF_ROOT_CLASS;
-
+
getter = lookup_method_static (interface, getter_name, flags);
setter = lookup_method_static (interface, setter_name, flags);
}
@@ -1293,7 +1293,7 @@ maybe_make_artificial_property_decl (tree interface, tree implementation,
else
{
getter = lookup_method (CLASS_NST_METHODS (implementation), getter_name);
- setter = lookup_method (CLASS_NST_METHODS (implementation), setter_name);
+ setter = lookup_method (CLASS_NST_METHODS (implementation), setter_name);
}
}
}
@@ -1313,17 +1313,17 @@ maybe_make_artificial_property_decl (tree interface, tree implementation,
/* Yes ... determine the type of the expression. */
tree property_decl;
tree type;
-
+
if (getter)
type = TREE_VALUE (TREE_TYPE (getter));
else
type = TREE_VALUE (TREE_TYPE (METHOD_SEL_ARGS (setter)));
-
+
/* Create an artificial property declaration with the
information we collected on the type and getter/setter
names. */
property_decl = make_node (PROPERTY_DECL);
-
+
TREE_TYPE (property_decl) = type;
DECL_SOURCE_LOCATION (property_decl) = input_location;
TREE_DEPRECATED (property_decl) = 0;
@@ -1383,10 +1383,10 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
/* Try to determine if 'object' is an Objective-C object or not. If
not, return. */
- if (object == NULL_TREE || object == error_mark_node
+ if (object == NULL_TREE || object == error_mark_node
|| (rtype = TREE_TYPE (object)) == NULL_TREE)
return NULL_TREE;
-
+
if (property_ident == NULL_TREE || property_ident == error_mark_node
|| TREE_CODE (property_ident) != IDENTIFIER_NODE)
return NULL_TREE;
@@ -1416,7 +1416,7 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
if (TYPE_HAS_OBJC_INFO (TREE_TYPE (rtype)))
{
tree rprotos = TYPE_OBJC_PROTOCOL_LIST (TREE_TYPE (rtype));
-
+
if (rprotos)
{
/* No point looking up declared @properties if we are
@@ -1434,7 +1434,7 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
an artifical property based on them if found. */
x = maybe_make_artificial_property_decl (NULL_TREE,
NULL_TREE,
- rprotos,
+ rprotos,
property_ident,
IS_CLASS (rtype),
NULL_TREE);
@@ -1454,7 +1454,7 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
rprotos,
property_ident,
false,
- PROPERTY_GETTER_NAME (x));
+ PROPERTY_GETTER_NAME (x));
}
}
}
@@ -1469,8 +1469,8 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
|| CONVERT_EXPR_P (t)
|| TREE_CODE (t) == COMPONENT_REF)
t = TREE_OPERAND (t, 0);
-
- if (t == UOBJC_SUPER_decl)
+
+ if (t == UOBJC_SUPER_decl)
interface_type = lookup_interface (CLASS_SUPER_NAME (implementation_template));
else if (t == self_decl)
interface_type = lookup_interface (CLASS_NAME (implementation_template));
@@ -1479,7 +1479,7 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
{
if (TREE_CODE (objc_method_context) != CLASS_METHOD_DECL)
x = lookup_property (interface_type, property_ident);
-
+
if (x == NULL_TREE)
{
/* Try the dot-syntax without a declared property.
@@ -1492,8 +1492,8 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
if (t == self_decl)
implementation = objc_implementation_context;
-
- x = maybe_make_artificial_property_decl
+
+ x = maybe_make_artificial_property_decl
(interface_type, implementation, NULL_TREE,
property_ident,
(TREE_CODE (objc_method_context) == CLASS_METHOD_DECL),
@@ -1502,16 +1502,16 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
else if (PROPERTY_OPTIONAL (x) && PROPERTY_READONLY (x))
{
tree implementation = NULL_TREE;
-
+
if (t == self_decl)
implementation = objc_implementation_context;
-
+
x = maybe_make_artificial_property_decl (interface_type,
implementation,
NULL_TREE,
property_ident,
false,
- PROPERTY_GETTER_NAME (x));
+ PROPERTY_GETTER_NAME (x));
}
}
}
@@ -1530,7 +1530,7 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
/* Traverse typedefs. */
while (basetype != NULL_TREE
- && TREE_CODE (basetype) == RECORD_TYPE
+ && TREE_CODE (basetype) == RECORD_TYPE
&& OBJC_TYPE_NAME (basetype)
&& TREE_CODE (OBJC_TYPE_NAME (basetype)) == TYPE_DECL
&& DECL_ORIGINAL_TYPE (OBJC_TYPE_NAME (basetype)))
@@ -1541,7 +1541,7 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
tree interface_type = TYPE_OBJC_INTERFACE (basetype);
tree protocol_list = TYPE_OBJC_PROTOCOL_LIST (basetype);
- if (interface_type
+ if (interface_type
&& (TREE_CODE (interface_type) == CLASS_INTERFACE_TYPE
|| TREE_CODE (interface_type) == CATEGORY_INTERFACE_TYPE
|| TREE_CODE (interface_type) == PROTOCOL_INTERFACE_TYPE))
@@ -1551,12 +1551,12 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
if (!IS_CLASS (rtype))
{
x = lookup_property (interface_type, property_ident);
-
+
if (x == NULL_TREE)
- x = lookup_property_in_protocol_list (protocol_list,
+ x = lookup_property_in_protocol_list (protocol_list,
property_ident);
}
-
+
if (x == NULL_TREE)
{
/* Try the dot-syntax without a declared property.
@@ -1568,13 +1568,13 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
tree implementation = NULL_TREE;
if (objc_implementation_context
- && CLASS_NAME (objc_implementation_context)
+ && CLASS_NAME (objc_implementation_context)
== OBJC_TYPE_NAME (interface_type))
implementation = objc_implementation_context;
-
+
x = maybe_make_artificial_property_decl (interface_type,
implementation,
- protocol_list,
+ protocol_list,
property_ident,
IS_CLASS (rtype),
NULL_TREE);
@@ -1584,17 +1584,17 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
tree implementation = NULL_TREE;
if (objc_implementation_context
- && CLASS_NAME (objc_implementation_context)
+ && CLASS_NAME (objc_implementation_context)
== OBJC_TYPE_NAME (interface_type))
implementation = objc_implementation_context;
-
+
x = maybe_make_artificial_property_decl (interface_type,
implementation,
protocol_list,
property_ident,
false,
- PROPERTY_GETTER_NAME (x));
- }
+ PROPERTY_GETTER_NAME (x));
+ }
}
}
}
@@ -1643,7 +1643,7 @@ objc_maybe_build_component_ref (tree object, tree property_ident)
deprecated_method_prototype);
SET_EXPR_LOCATION (expression, input_location);
TREE_SIDE_EFFECTS (expression) = 1;
-
+
return expression;
}
@@ -1659,25 +1659,25 @@ objc_build_class_component_ref (tree class_name, tree property_ident)
{
tree x = NULL_TREE;
tree object, rtype;
-
+
if (flag_objc1_only)
error_at (input_location, "the dot syntax is not available in Objective-C 1.0");
-
+
if (class_name == NULL_TREE || class_name == error_mark_node
|| TREE_CODE (class_name) != IDENTIFIER_NODE)
return error_mark_node;
-
+
if (property_ident == NULL_TREE || property_ident == error_mark_node
|| TREE_CODE (property_ident) != IDENTIFIER_NODE)
return NULL_TREE;
-
+
object = objc_get_class_reference (class_name);
if (!object)
{
/* We know that 'class_name' is an Objective-C class name as the
parser won't call this function if it is not. This is only a
double-check for safety. */
- error_at (input_location, "could not find class %qE", class_name);
+ error_at (input_location, "could not find class %qE", class_name);
return error_mark_node;
}
@@ -1685,19 +1685,19 @@ objc_build_class_component_ref (tree class_name, tree property_ident)
if (!rtype)
{
/* Again, this should never happen, but we do check. */
- error_at (input_location, "could not find interface for class %qE", class_name);
+ error_at (input_location, "could not find interface for class %qE", class_name);
return error_mark_node;
}
else
{
if (TREE_DEPRECATED (rtype))
- warning (OPT_Wdeprecated_declarations, "class %qE is deprecated", class_name);
+ warning (OPT_Wdeprecated_declarations, "class %qE is deprecated", class_name);
}
x = maybe_make_artificial_property_decl (rtype, NULL_TREE, NULL_TREE,
property_ident,
true, NULL_TREE);
-
+
if (x)
{
tree expression;
@@ -1720,8 +1720,8 @@ objc_build_class_component_ref (tree class_name, tree property_ident)
}
else
{
- error_at (input_location, "could not find setter/getter for %qE in class %qE",
- property_ident, class_name);
+ error_at (input_location, "could not find setter/getter for %qE in class %qE",
+ property_ident, class_name);
return error_mark_node;
}
@@ -1753,21 +1753,21 @@ objc_build_setter_call (tree lhs, tree rhs)
{
tree object_expr = PROPERTY_REF_OBJECT (lhs);
tree property_decl = PROPERTY_REF_PROPERTY_DECL (lhs);
-
+
if (PROPERTY_READONLY (property_decl))
{
- error ("readonly property can not be set");
+ error ("readonly property can not be set");
return error_mark_node;
}
else
{
tree setter_argument = build_tree_list (NULL_TREE, rhs);
tree setter;
-
+
/* TODO: Check that the setter return type is 'void'. */
/* TODO: Decay arguments in C. */
- setter = objc_finish_message_expr (object_expr,
+ setter = objc_finish_message_expr (object_expr,
PROPERTY_SETTER_NAME (property_decl),
setter_argument, NULL);
return setter;
@@ -1829,7 +1829,7 @@ objc_maybe_build_modify_expr (tree lhs, tree rhs)
if (TREE_SIDE_EFFECTS (rhs))
{
tree bind;
-
+
/* Declare __objc_property_temp in a local bind. */
setter_argument = objc_create_temporary_var (TREE_TYPE (rhs), "__objc_property_temp");
DECL_SOURCE_LOCATION (setter_argument) = input_location;
@@ -1850,19 +1850,19 @@ objc_maybe_build_modify_expr (tree lhs, tree rhs)
setter_argument = rhs;
s1 = NULL_TREE;
}
-
+
/* Now build the compound statement. */
-
+
/* s2: [object setProperty: x] */
s2 = objc_build_setter_call (lhs, setter_argument);
-
+
/* This happens if building the setter failed because the
property is readonly. */
if (s2 == error_mark_node)
return error_mark_node;
SET_EXPR_LOCATION (s2, input_location);
-
+
/* s3: x */
s3 = convert (TREE_TYPE (lhs), setter_argument);
@@ -1871,7 +1871,7 @@ objc_maybe_build_modify_expr (tree lhs, tree rhs)
if (s1)
compound_expr = build_compound_expr (input_location, build_compound_expr (input_location, s1, s2), s3);
else
- compound_expr = build_compound_expr (input_location, s2, s3);
+ compound_expr = build_compound_expr (input_location, s2, s3);
/* Without this, with -Wall you get a 'valued computed is not
used' every time there is a "object.property = x" where the
@@ -1897,25 +1897,25 @@ objc_maybe_build_modify_expr (tree lhs, tree rhs)
'setter' for the property in an appropriate way to build the
appropriate expression. 'code' is the code for the expression (one
of the four mentioned above); 'argument' is the PROPERTY_REF, and
- 'increment' is how much we need to add or subtract. */
+ 'increment' is how much we need to add or subtract. */
tree
objc_build_incr_expr_for_property_ref (location_t location,
- enum tree_code code,
+ enum tree_code code,
tree argument, tree increment)
{
/* Here are the expressions that we want to build:
For PREINCREMENT_EXPR / PREDECREMENT_EXPR:
(temp = [object property] +/- increment, [object setProperty: temp], temp)
-
+
For POSTINCREMENT_EXPR / POSTECREMENT_EXPR:
(temp = [object property], [object setProperty: temp +/- increment], temp) */
-
+
tree temp_variable_decl, bind;
/* s1, s2 and s3 are the tree statements that we need in the
compound expression. */
tree s1, s2, s3, compound_expr;
-
+
/* Safety check. */
if (!argument || TREE_CODE (argument) != PROPERTY_REF)
return error_mark_node;
@@ -1927,28 +1927,28 @@ objc_build_incr_expr_for_property_ref (location_t location,
SET_EXPR_LOCATION (bind, location);
TREE_SIDE_EFFECTS (bind) = 1;
add_stmt (bind);
-
+
/* Now build the compound statement. */
-
+
/* Note that the 'getter' is generated at gimplify time; at this
time, we can simply put the property_ref (ie, argument) wherever
we want the getter ultimately to be. */
-
+
/* s1: __objc_property_temp = [object property] <+/- increment> */
switch (code)
{
- case PREINCREMENT_EXPR:
+ case PREINCREMENT_EXPR:
/* __objc_property_temp = [object property] + increment */
s1 = build_modify_expr (location, temp_variable_decl, NULL_TREE,
NOP_EXPR,
- location, build2 (PLUS_EXPR, TREE_TYPE (argument),
+ location, build2 (PLUS_EXPR, TREE_TYPE (argument),
argument, increment), NULL_TREE);
break;
case PREDECREMENT_EXPR:
/* __objc_property_temp = [object property] - increment */
s1 = build_modify_expr (location, temp_variable_decl, NULL_TREE,
NOP_EXPR,
- location, build2 (MINUS_EXPR, TREE_TYPE (argument),
+ location, build2 (MINUS_EXPR, TREE_TYPE (argument),
argument, increment), NULL_TREE);
break;
case POSTINCREMENT_EXPR:
@@ -1961,11 +1961,11 @@ objc_build_incr_expr_for_property_ref (location_t location,
default:
gcc_unreachable ();
}
-
+
/* s2: [object setProperty: __objc_property_temp <+/- increment>] */
switch (code)
{
- case PREINCREMENT_EXPR:
+ case PREINCREMENT_EXPR:
case PREDECREMENT_EXPR:
/* [object setProperty: __objc_property_temp] */
s2 = objc_build_setter_call (argument, temp_variable_decl);
@@ -1973,13 +1973,13 @@ objc_build_incr_expr_for_property_ref (location_t location,
case POSTINCREMENT_EXPR:
/* [object setProperty: __objc_property_temp + increment] */
s2 = objc_build_setter_call (argument,
- build2 (PLUS_EXPR, TREE_TYPE (argument),
+ build2 (PLUS_EXPR, TREE_TYPE (argument),
temp_variable_decl, increment));
break;
case POSTDECREMENT_EXPR:
/* [object setProperty: __objc_property_temp - increment] */
s2 = objc_build_setter_call (argument,
- build2 (MINUS_EXPR, TREE_TYPE (argument),
+ build2 (MINUS_EXPR, TREE_TYPE (argument),
temp_variable_decl, increment));
break;
default:
@@ -1991,11 +1991,11 @@ objc_build_incr_expr_for_property_ref (location_t location,
if (s2 == error_mark_node)
return error_mark_node;
- SET_EXPR_LOCATION (s2, location);
-
+ SET_EXPR_LOCATION (s2, location);
+
/* s3: __objc_property_temp */
s3 = convert (TREE_TYPE (argument), temp_variable_decl);
-
+
/* Now build the compound statement (s1, s2, s3) */
compound_expr = build_compound_expr (location, build_compound_expr (location, s1, s2), s3);
@@ -2391,8 +2391,8 @@ objc_common_type (tree type1, tree type2)
-2 Initialization;
-3 Comparison (LTYP and RTYP may match in either direction);
-4 Silent comparison (for C++ overload resolution);
- -5 Silent "specialization" comparison for RTYP to be a "specialization"
- of LTYP (a specialization means that RTYP is LTYP plus some constraints,
+ -5 Silent "specialization" comparison for RTYP to be a "specialization"
+ of LTYP (a specialization means that RTYP is LTYP plus some constraints,
so that each object of type RTYP is also of type LTYP). This is used
when comparing property types. */
@@ -2496,7 +2496,7 @@ objc_compare_types (tree ltyp, tree rtyp, int argno, tree callee)
if (!lproto && objc_is_object_id (ltyp))
return true;
}
-
+
pointers_compatible = (TYPE_MAIN_VARIANT (ltyp) == TYPE_MAIN_VARIANT (rtyp));
/* If the underlying types are the same, and at most one of them has
@@ -2521,7 +2521,7 @@ objc_compare_types (tree ltyp, tree rtyp, int argno, tree callee)
pointers_compatible
= (objc_is_object_id (ltyp) || objc_is_object_id (rtyp));
else
- pointers_compatible = objc_is_object_id (ltyp);
+ pointers_compatible = objc_is_object_id (ltyp);
}
if (!pointers_compatible)
@@ -2588,7 +2588,7 @@ objc_compare_types (tree ltyp, tree rtyp, int argno, tree callee)
variety and calls objc_common_type to obtain a common type. There is no commonolty
between two function-pointers in this regard. */
-bool
+bool
objc_have_common_type (tree ltyp, tree rtyp, int argno, tree callee)
{
if (objc_compare_types (ltyp, rtyp, argno, callee))
@@ -2785,7 +2785,7 @@ objc_get_protocol_qualified_type (tree interface, tree protocols)
TREE_TYPE (type) = build_variant_type_copy (orig_pointee_type);
/* Set up the canonical type information. */
- TYPE_CANONICAL (type)
+ TYPE_CANONICAL (type)
= TYPE_CANONICAL (TYPE_POINTER_TO (orig_pointee_type));
TYPE_POINTER_TO (TREE_TYPE (type)) = type;
@@ -2993,12 +2993,12 @@ synth_module_prologue (void)
/* Declare struct _objc_fast_enumeration_state { ... }; */
build_fast_enumeration_state_template ();
-
+
/* void objc_enumeration_mutation (id) */
type = build_function_type_list (void_type_node,
objc_object_type, NULL_TREE);
- objc_enumeration_mutation_decl
- = add_builtin_function (TAG_ENUMERATION_MUTATION, type, 0, NOT_BUILT_IN,
+ objc_enumeration_mutation_decl
+ = add_builtin_function (TAG_ENUMERATION_MUTATION, type, 0, NOT_BUILT_IN,
NULL, NULL_TREE);
TREE_NOTHROW (objc_enumeration_mutation_decl) = 0;
@@ -3140,11 +3140,11 @@ objc_build_string_object (tree string)
TREE_SET_CODE (string, STRING_CST);
length = TREE_STRING_LENGTH (string) - 1;
- /* The target may have different ideas on how to construct an ObjC string
- literal. On Darwin (Mac OS X), for example, we may wish to obtain a
+ /* The target may have different ideas on how to construct an ObjC string
+ literal. On Darwin (Mac OS X), for example, we may wish to obtain a
constant CFString reference instead.
At present, this is only supported for the NeXT runtime. */
- if (flag_next_runtime
+ if (flag_next_runtime
&& targetcm.objc_construct_string_object)
{
tree constructor = (*targetcm.objc_construct_string_object) (string);
@@ -3192,7 +3192,7 @@ objc_build_string_object (tree string)
{
*loc = desc = ggc_alloc_string_descriptor ();
desc->literal = string;
- desc->constructor =
+ desc->constructor =
(*runtime.build_const_string_constructor) (input_location, string, length);
}
@@ -3354,7 +3354,7 @@ objc_declare_alias (tree alias_ident, tree class_ident)
#ifdef OBJCPLUS
pop_lang_context ();
#endif
- hash_class_name_enter (als_name_hash_list, alias_ident,
+ hash_class_name_enter (als_name_hash_list, alias_ident,
underlying_class);
}
}
@@ -3371,14 +3371,14 @@ objc_declare_class (tree identifier)
if (! objc_is_class_name (identifier))
{
tree record = lookup_name (identifier), type = record;
-
+
if (record)
{
if (TREE_CODE (record) == TYPE_DECL)
type = DECL_ORIGINAL_TYPE (record)
? DECL_ORIGINAL_TYPE (record)
: TREE_TYPE (record);
-
+
if (!TYPE_HAS_OBJC_INFO (type)
|| !TYPE_OBJC_INTERFACE (type))
{
@@ -3388,7 +3388,7 @@ objc_declare_class (tree identifier)
record);
}
}
-
+
record = xref_tag (RECORD_TYPE, identifier);
INIT_TYPE_OBJC_INFO (record);
/* In the case of a @class declaration, we store the ident in
@@ -3577,7 +3577,7 @@ objc_build_global_assignment (tree lhs, tree rhs)
NULL_TREE));
assemble_external (objc_assign_global_decl);
- return build_function_call (input_location,
+ return build_function_call (input_location,
objc_assign_global_decl, func_params);
}
@@ -3867,18 +3867,18 @@ eq_instance_variable (const PTR p1, const PTR p2)
bool
objc_detect_field_duplicates (bool check_superclasses_only)
{
- if (!objc_collecting_ivars || !objc_interface_context
+ if (!objc_collecting_ivars || !objc_interface_context
|| TREE_CODE (objc_interface_context) != CLASS_INTERFACE_TYPE)
return false;
/* We have two ways of doing this check:
-
+
"direct comparison": we iterate over the instance variables and
compare them directly. This works great for small numbers of
instance variables (such as 10 or 20), which are extremely common.
But it will potentially take forever for the pathological case with
a huge number (eg, 10k) of instance variables.
-
+
"hashtable": we use a hashtable, which requires a single sweep
through the list of instances variables. This is much slower for a
small number of variables, and we only use it for large numbers.
@@ -3901,7 +3901,7 @@ objc_detect_field_duplicates (bool check_superclasses_only)
/* Exit if there is nothing to do. */
if (number_of_ivars_to_check == 0)
return true;
-
+
/* In case that there are only 1 or 2 instance variables to check,
we always use direct comparison. If there are more, it is
worth iterating over the instance variables in the superclass
@@ -3926,7 +3926,7 @@ objc_detect_field_duplicates (bool check_superclasses_only)
}
/* We use a hashtable if we have over 10k comparisons. */
- if (number_of_ivars_to_check * (number_of_superclass_ivars
+ if (number_of_ivars_to_check * (number_of_superclass_ivars
+ (number_of_ivars_to_check / 2))
> 10000)
{
@@ -3954,7 +3954,7 @@ objc_detect_field_duplicates (bool check_superclasses_only)
}
}
}
-
+
/* Now, we go through all the instance variables in the
class, and check that they are not in the
hashtable. */
@@ -4015,7 +4015,7 @@ objc_detect_field_duplicates (bool check_superclasses_only)
}
}
}
-
+
/* This is the "direct comparison" approach, which is used in most
non-pathological cases. */
{
@@ -4026,7 +4026,7 @@ objc_detect_field_duplicates (bool check_superclasses_only)
if (check_superclasses_only)
interface = lookup_interface (CLASS_SUPER_NAME (interface));
-
+
for ( ; interface; interface = lookup_interface
(CLASS_SUPER_NAME (interface)))
{
@@ -4037,7 +4037,7 @@ objc_detect_field_duplicates (bool check_superclasses_only)
ivar_being_checked = DECL_CHAIN (ivar_being_checked))
{
tree decl;
-
+
/* Ignore anonymous ivars. */
if (DECL_NAME (ivar_being_checked) == NULL_TREE)
continue;
@@ -4205,7 +4205,7 @@ objc_begin_catch_clause (tree decl)
&& TYPE_OBJC_PROTOCOL_LIST (TREE_TYPE (type)))
{
error ("@catch parameter can not be protocol-qualified");
- type = error_mark_node;
+ type = error_mark_node;
}
else if (POINTER_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
/* @catch (id xyz) or @catch (...) but we note this for runtimes that
@@ -4217,11 +4217,11 @@ objc_begin_catch_clause (tree decl)
them and get a simple pointer to the class. */
bool is_typedef = false;
tree x = TYPE_MAIN_VARIANT (type);
-
+
/* Skip from the pointer to the pointee. */
if (TREE_CODE (x) == POINTER_TYPE)
x = TREE_TYPE (x);
-
+
/* Traverse typedef aliases */
while (TREE_CODE (x) == RECORD_TYPE && OBJC_TYPE_NAME (x)
&& TREE_CODE (OBJC_TYPE_NAME (x)) == TYPE_DECL
@@ -4364,7 +4364,7 @@ objc_build_synchronized (location_t start_locus, tree object_expr, tree body)
object_expr = error_mark_node;
}
}
-
+
if (object_expr == error_mark_node)
{
/* If we found an error, we simply ignore the '@synchronized'.
@@ -4377,7 +4377,7 @@ objc_build_synchronized (location_t start_locus, tree object_expr, tree body)
tree call;
tree args;
- /* objc_sync_enter (object_expr); */
+ /* objc_sync_enter (object_expr); */
object_expr = save_expr (object_expr);
args = tree_cons (NULL, object_expr, NULL);
call = build_function_call (input_location,
@@ -4394,10 +4394,10 @@ objc_build_synchronized (location_t start_locus, tree object_expr, tree body)
/* @try { body; } */
objc_begin_try_stmt (start_locus, body);
-
+
/* @finally { objc_sync_exit (object_expr); } */
objc_build_finally_clause (input_location, call);
-
+
/* End of try statement. */
return objc_finish_try_stmt ();
}
@@ -4789,7 +4789,7 @@ adjust_type_for_id_default (tree type)
For example, take the Objective-C method
- -(NSString *)pathForResource:(NSString *)resource ofType:(NSString *)type;
+ -(NSString *)pathForResource:(NSString *)resource ofType:(NSString *)type;
the two fragments "pathForResource:(NSString *)resource" and
"ofType:(NSString *)type" will generate a KEYWORD_DECL each. The
@@ -4809,7 +4809,7 @@ adjust_type_for_id_default (tree type)
'arg_name' is an identifier node and is required.
'attributes' is an optional tree containing parameter attributes. */
tree
-objc_build_keyword_decl (tree key_name, tree arg_type,
+objc_build_keyword_decl (tree key_name, tree arg_type,
tree arg_name, tree attributes)
{
tree keyword_decl;
@@ -4951,14 +4951,14 @@ objc_decl_method_attributes (tree *node, tree attributes, int flags)
for (attribute = attributes; attribute; attribute = TREE_CHAIN (attribute))
{
tree name = TREE_PURPOSE (attribute);
-
+
if (is_attribute_p ("deprecated", name)
|| is_attribute_p ("sentinel", name)
|| is_attribute_p ("noreturn", name))
{
/* An attribute that we support; add it to the filtered
attributes. */
- filtered_attributes = chainon (filtered_attributes,
+ filtered_attributes = chainon (filtered_attributes,
copy_node (attribute));
}
else if (is_attribute_p ("format", name))
@@ -4998,11 +4998,11 @@ objc_decl_method_attributes (tree *node, tree attributes, int flags)
&& TREE_CODE (number) == INTEGER_CST
&& TREE_INT_CST_HIGH (number) == 0)
{
- TREE_VALUE (second_argument)
+ TREE_VALUE (second_argument)
= build_int_cst (integer_type_node,
TREE_INT_CST_LOW (number) + 2);
}
-
+
/* This is the third argument, the "first-to-check",
which specifies the index of the first argument to
check. This could be 0, meaning it is not available,
@@ -5014,7 +5014,7 @@ objc_decl_method_attributes (tree *node, tree attributes, int flags)
&& TREE_INT_CST_HIGH (number) == 0
&& TREE_INT_CST_LOW (number) != 0)
{
- TREE_VALUE (third_argument)
+ TREE_VALUE (third_argument)
= build_int_cst (integer_type_node,
TREE_INT_CST_LOW (number) + 2);
}
@@ -5040,7 +5040,7 @@ objc_decl_method_attributes (tree *node, tree attributes, int flags)
(by setting TREE_DEPRECATED and TREE_THIS_VOLATILE) so there
is nothing to do. */
tree saved_type = TREE_TYPE (*node);
- TREE_TYPE (*node) = build_function_type
+ TREE_TYPE (*node) = build_function_type
(TREE_VALUE (saved_type), get_arg_type_list (*node, METHOD_REF, 0));
decl_attributes (node, filtered_attributes, flags);
METHOD_TYPE_ATTRIBUTES (*node) = TYPE_ATTRIBUTES (TREE_TYPE (*node));
@@ -5048,7 +5048,7 @@ objc_decl_method_attributes (tree *node, tree attributes, int flags)
}
}
-bool
+bool
objc_method_decl (enum tree_code opcode)
{
return opcode == INSTANCE_METHOD_DECL || opcode == CLASS_METHOD_DECL;
@@ -5461,7 +5461,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params,
if (!rtype || TREE_CODE (rtype) == IDENTIFIER_NODE)
{
rtype = NULL_TREE;
- /* We could not find an @interface declaration, yet Message maybe in a
+ /* We could not find an @interface declaration, yet Message maybe in a
@class's protocol. */
if (!method_prototype && rprotos)
method_prototype
@@ -5521,7 +5521,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params,
= lookup_method_in_hash_lists (sel_name, class_tree != NULL_TREE);
}
- if (!method_prototype)
+ if (!method_prototype)
{
static bool warn_missing_methods = false;
@@ -5540,11 +5540,11 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params,
if (!warn_missing_methods)
{
- warning_at (input_location,
+ warning_at (input_location,
0, "(Messages without a matching method signature");
- warning_at (input_location,
+ warning_at (input_location,
0, "will be assumed to return %<id%> and accept");
- warning_at (input_location,
+ warning_at (input_location,
0, "%<...%> as arguments.)");
warn_missing_methods = true;
}
@@ -5578,9 +5578,9 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params,
current_objc_message_selector = sel_name;
/* Build the method call.
- TODO: Get the location from somewhere that will work for delayed
+ TODO: Get the location from somewhere that will work for delayed
expansion. */
-
+
retval = (*runtime.build_objc_method_call) (input_location, method_prototype,
receiver, rtype, sel_name,
method_params, super);
@@ -5591,7 +5591,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params,
}
-/* This routine creates a static variable used to implement @protocol(MyProtocol)
+/* This routine creates a static variable used to implement @protocol(MyProtocol)
expression. This variable will be initialized to global protocol_t meta-data
pointer. */
@@ -5930,7 +5930,7 @@ lookup_method_static (tree interface, tree ident, int flags)
}
else
{
- /* If an instance method was not found, return 0. */
+ /* If an instance method was not found, return 0. */
return NULL_TREE;
}
}
@@ -6004,7 +6004,7 @@ objc_add_method (tree klass, tree method, int is_class, bool is_optional)
existing_method = lookup_method (PROTOCOL_OPTIONAL_CLS_METHODS (klass), method);
else
existing_method = lookup_method (PROTOCOL_OPTIONAL_NST_METHODS (klass), method);
-
+
if (!is_optional && existing_method)
{
error ("method %<%c%E%> declared %<@optional%> and %<@required%> at the same time",
@@ -6217,7 +6217,7 @@ printable_ivar_name (tree field_decl)
VISIBILITY is 1 for public, 0 for protected, and 2 for private. */
static tree
-add_instance_variable (tree klass, objc_ivar_visibility_kind visibility,
+add_instance_variable (tree klass, objc_ivar_visibility_kind visibility,
tree field_decl)
{
tree field_type = TREE_TYPE (field_decl);
@@ -6260,7 +6260,7 @@ add_instance_variable (tree klass, objc_ivar_visibility_kind visibility,
error ("instance variable %qs uses flexible array member",
printable_ivar_name (field_decl));
/* Return class as is without adding this ivar. */
- return klass;
+ return klass;
}
#endif
@@ -6385,9 +6385,9 @@ ivar_of_class (tree klass, tree ivar_name_ident)
while (CLASS_SUPER_NAME (klass))
{
klass = lookup_interface (CLASS_SUPER_NAME (klass));
-
+
decl_chain = CLASS_RAW_IVARS (klass);
-
+
for ( ; decl_chain; decl_chain = DECL_CHAIN (decl_chain))
if (DECL_NAME (decl_chain) == ivar_name_ident)
return decl_chain;
@@ -6515,7 +6515,7 @@ check_methods (tree chain, tree implementation, int mtype)
&& (PROPERTY_GETTER_NAME (x) == METHOD_SEL_NAME (chain)
|| PROPERTY_SETTER_NAME (x) == METHOD_SEL_NAME (chain)))
break;
-
+
if (x != NULL_TREE)
{
chain = TREE_CHAIN (chain); /* next method... */
@@ -6544,7 +6544,7 @@ check_methods (tree chain, tree implementation, int mtype)
if (lookup_method (CLASS_NST_METHODS (interface), chain))
{
chain = DECL_CHAIN (chain);
- continue;
+ continue;
}
/* Else, get the superclass. */
@@ -6650,12 +6650,12 @@ check_methods_accessible (tree chain, tree context, int mtype)
&& (PROPERTY_GETTER_NAME (x) == METHOD_SEL_NAME (chain)
|| PROPERTY_SETTER_NAME (x) == METHOD_SEL_NAME (chain)))
break;
-
+
if (x != NULL_TREE)
{
chain = TREE_CHAIN (chain); /* next method... */
continue;
- }
+ }
context = base_context;
while (context)
@@ -6834,7 +6834,7 @@ start_class (enum tree_code code, tree class_name, tree super_name,
if (super)
super_interface = lookup_interface (super);
-
+
if (!super_interface)
{
error ("cannot find interface declaration for %qE, superclass of %qE",
@@ -6845,7 +6845,7 @@ start_class (enum tree_code code, tree class_name, tree super_name,
else
{
if (TREE_DEPRECATED (super_interface))
- warning (OPT_Wdeprecated_declarations, "class %qE is deprecated",
+ warning (OPT_Wdeprecated_declarations, "class %qE is deprecated",
super);
super_name = super;
}
@@ -6872,7 +6872,7 @@ start_class (enum tree_code code, tree class_name, tree super_name,
case CLASS_IMPLEMENTATION_TYPE:
{
tree chain;
-
+
for (chain = implemented_classes; chain; chain = TREE_CHAIN (chain))
if (TREE_VALUE (chain) == class_name)
{
@@ -6933,7 +6933,7 @@ start_class (enum tree_code code, tree class_name, tree super_name,
#endif
else
add_class (klass, class_name);
-
+
if (protocol_list)
CLASS_PROTOCOL_LIST (klass)
= lookup_and_install_protocols (protocol_list, /* definition_required */ true);
@@ -6944,7 +6944,7 @@ start_class (enum tree_code code, tree class_name, tree super_name,
for (attribute = attributes; attribute; attribute = TREE_CHAIN (attribute))
{
tree name = TREE_PURPOSE (attribute);
-
+
/* TODO: Document what the objc_exception attribute is/does. */
/* We handle the 'deprecated' and (undocumented) 'objc_exception'
attributes. */
@@ -6958,12 +6958,12 @@ start_class (enum tree_code code, tree class_name, tree super_name,
}
TYPE_ATTRIBUTES (klass) = attributes;
}
- break;
+ break;
case CATEGORY_INTERFACE_TYPE:
{
tree class_category_is_assoc_with;
-
+
/* For a category, class_name is really the name of the class that
the following set of methods will be associated with. We must
find the interface so that can derive the objects template. */
@@ -6976,7 +6976,7 @@ start_class (enum tree_code code, tree class_name, tree super_name,
else
{
if (TREE_DEPRECATED (class_category_is_assoc_with))
- warning (OPT_Wdeprecated_declarations, "class %qE is deprecated",
+ warning (OPT_Wdeprecated_declarations, "class %qE is deprecated",
class_name);
if (super_name == NULL_TREE)
@@ -7000,7 +7000,7 @@ start_class (enum tree_code code, tree class_name, tree super_name,
else
{
add_category (class_category_is_assoc_with, klass);
-
+
if (protocol_list)
CLASS_PROTOCOL_LIST (klass)
= lookup_and_install_protocols
@@ -7009,7 +7009,7 @@ start_class (enum tree_code code, tree class_name, tree super_name,
}
}
break;
-
+
case CATEGORY_IMPLEMENTATION_TYPE:
/* Reset for multiple classes per file. */
method_slot = 0;
@@ -7047,7 +7047,7 @@ continue_class (tree klass)
if (CLASS_RAW_IVARS (klass))
check_ivars (implementation_template, klass);
-
+
/* code generation */
#ifdef OBJCPLUS
push_lang_context (lang_name_c);
@@ -7083,7 +7083,7 @@ continue_class (tree klass)
#ifdef OBJCPLUS
pop_lang_context ();
#endif /* OBJCPLUS */
-
+
return get_class_ivars (implementation_template, true);
break;
}
@@ -7121,18 +7121,18 @@ objc_build_property_setter_name (tree ident)
/* This routine prepares the declarations of the property accessor
helper functions (objc_getProperty(), etc) that are used when
- @synthesize is used.
-
- runtime-specific routines are built in the respective runtime
+ @synthesize is used.
+
+ runtime-specific routines are built in the respective runtime
initialize functions. */
-static void
+static void
build_common_objc_property_accessor_helpers (void)
{
tree type;
/* Declare the following function:
id
- objc_getProperty (id self, SEL _cmd,
+ objc_getProperty (id self, SEL _cmd,
ptrdiff_t offset, BOOL is_atomic); */
type = build_function_type_list (objc_object_type,
objc_object_type,
@@ -7144,11 +7144,11 @@ build_common_objc_property_accessor_helpers (void)
type, 0, NOT_BUILT_IN,
NULL, NULL_TREE);
TREE_NOTHROW (objc_getProperty_decl) = 0;
-
+
/* Declare the following function:
void
- objc_setProperty (id self, SEL _cmd,
- ptrdiff_t offset, id new_value,
+ objc_setProperty (id self, SEL _cmd,
+ ptrdiff_t offset, id new_value,
BOOL is_atomic, BOOL should_copy); */
type = build_function_type_list (void_type_node,
objc_object_type,
@@ -7171,16 +7171,16 @@ lookup_ivar (tree interface, tree instance_variable_name)
while (interface)
{
tree decl_chain;
-
+
for (decl_chain = CLASS_IVARS (interface); decl_chain; decl_chain = DECL_CHAIN (decl_chain))
if (DECL_NAME (decl_chain) == instance_variable_name)
return decl_chain;
-
+
/* Not found. Search superclass if any. */
if (CLASS_SUPER_NAME (interface))
interface = lookup_interface (CLASS_SUPER_NAME (interface));
}
-
+
return NULL_TREE;
}
@@ -7273,7 +7273,7 @@ objc_synthesize_getter (tree klass, tree class_methods ATTRIBUTE_UNUSED, tree pr
(NULL_TREE, is_atomic, NULL_TREE)))));
}
break;
- case OBJC_PROPERTY_ASSIGN:
+ case OBJC_PROPERTY_ASSIGN:
if (PROPERTY_NONATOMIC (property))
{
/* We build "return self->PROPERTY_IVAR_NAME;" */
@@ -7305,12 +7305,12 @@ objc_synthesize_getter (tree klass, tree class_methods ATTRIBUTE_UNUSED, tree pr
size_of = c_sizeof_or_alignof_type (location, TREE_TYPE (property),
true /* is_sizeof */,
false /* complain */);
-
+
if (PROPERTY_NONATOMIC (property))
is_atomic = boolean_false_node;
else
is_atomic = boolean_true_node;
-
+
if (objc_copyStruct_decl)
function_decl = objc_copyStruct_decl;
else
@@ -7326,8 +7326,8 @@ objc_synthesize_getter (tree klass, tree class_methods ATTRIBUTE_UNUSED, tree pr
here causes invalid code to be generated. */
(NULL_TREE, build_unary_op (location, ADDR_EXPR, objc_property_temp_decl, 0),
tree_cons /* &(self->PROPERTY_IVAR_NAME); */
- (NULL_TREE, build_fold_addr_expr_loc (location,
- objc_lookup_ivar
+ (NULL_TREE, build_fold_addr_expr_loc (location,
+ objc_lookup_ivar
(NULL_TREE, PROPERTY_IVAR_NAME (property))),
tree_cons /* sizeof (PROPERTY_IVAR) */
(NULL_TREE, size_of,
@@ -7451,7 +7451,7 @@ objc_synthesize_setter (tree klass, tree class_methods ATTRIBUTE_UNUSED, tree pr
is_atomic = boolean_false_node;
else
is_atomic = boolean_true_node;
-
+
if (PROPERTY_ASSIGN_SEMANTICS (property) == OBJC_PROPERTY_COPY)
should_copy = boolean_true_node;
else
@@ -7471,19 +7471,19 @@ objc_synthesize_setter (tree klass, tree class_methods ATTRIBUTE_UNUSED, tree pr
tree_cons /* new_value */
(NULL_TREE, new_value,
tree_cons /* is_atomic */
- (NULL_TREE, is_atomic,
+ (NULL_TREE, is_atomic,
tree_cons /* should_copy */
(NULL_TREE, should_copy, NULL_TREE)))))));
}
break;
- case OBJC_PROPERTY_ASSIGN:
+ case OBJC_PROPERTY_ASSIGN:
if (PROPERTY_NONATOMIC (property))
{
/* We build "self->PROPERTY_IVAR_NAME = new_value;" */
statement = build_modify_expr
(location,
objc_lookup_ivar (NULL_TREE, PROPERTY_IVAR_NAME (property)),
- NULL_TREE, NOP_EXPR,
+ NULL_TREE, NOP_EXPR,
location, new_value, NULL_TREE);
break;
}
@@ -7505,25 +7505,25 @@ objc_synthesize_setter (tree klass, tree class_methods ATTRIBUTE_UNUSED, tree pr
size_of = c_sizeof_or_alignof_type (location, TREE_TYPE (property),
true /* is_sizeof */,
false /* complain */);
-
+
if (PROPERTY_NONATOMIC (property))
is_atomic = boolean_false_node;
else
is_atomic = boolean_true_node;
-
+
if (objc_copyStruct_decl)
function_decl = objc_copyStruct_decl;
else
function_decl = objc_setPropertyStruct_decl;
- statement = build_function_call
+ statement = build_function_call
(location,
/* Function prototype. */
function_decl,
/* Parameters. */
tree_cons /* &(self->PROPERTY_IVAR_NAME); */
- (NULL_TREE, build_fold_addr_expr_loc (location,
- objc_lookup_ivar
+ (NULL_TREE, build_fold_addr_expr_loc (location,
+ objc_lookup_ivar
(NULL_TREE, PROPERTY_IVAR_NAME (property))),
tree_cons /* &new_value */
(NULL_TREE, build_fold_addr_expr_loc (location, new_value),
@@ -7542,7 +7542,7 @@ objc_synthesize_setter (tree klass, tree class_methods ATTRIBUTE_UNUSED, tree pr
}
gcc_assert (statement);
- add_stmt (statement);
+ add_stmt (statement);
add_stmt (c_end_compound_stmt (location, body, true));
fn = current_function_decl;
#ifdef OBJCPLUS
@@ -7568,14 +7568,14 @@ objc_add_synthesize_declaration_for_property (location_t location, tree interfac
if (PROPERTY_NAME (property) == property_name)
{
location_t original_location = DECL_SOURCE_LOCATION (property);
-
+
if (PROPERTY_DYNAMIC (property))
- error_at (location, "property %qs already specified in %<@dynamic%>",
+ error_at (location, "property %qs already specified in %<@dynamic%>",
IDENTIFIER_POINTER (property_name));
else
- error_at (location, "property %qs already specified in %<@synthesize%>",
+ error_at (location, "property %qs already specified in %<@synthesize%>",
IDENTIFIER_POINTER (property_name));
-
+
if (original_location != UNKNOWN_LOCATION)
inform (original_location, "originally specified here");
return;
@@ -7587,7 +7587,7 @@ objc_add_synthesize_declaration_for_property (location_t location, tree interfac
if (!property)
{
- error_at (location, "no declaration of property %qs found in the interface",
+ error_at (location, "no declaration of property %qs found in the interface",
IDENTIFIER_POINTER (property_name));
return;
}
@@ -7614,7 +7614,7 @@ objc_add_synthesize_declaration_for_property (location_t location, tree interfac
tree type_of_ivar;
if (!ivar)
{
- error_at (location, "ivar %qs used by %<@synthesize%> declaration must be an existing ivar",
+ error_at (location, "ivar %qs used by %<@synthesize%> declaration must be an existing ivar",
IDENTIFIER_POINTER (property_name));
return;
}
@@ -7623,7 +7623,7 @@ objc_add_synthesize_declaration_for_property (location_t location, tree interfac
type_of_ivar = DECL_BIT_FIELD_TYPE (ivar);
else
type_of_ivar = TREE_TYPE (ivar);
-
+
/* If the instance variable has a different C type, we throw an error ... */
if (!comptypes (TREE_TYPE (property), type_of_ivar)
/* ... unless the property is readonly, in which case we allow
@@ -7634,11 +7634,11 @@ objc_add_synthesize_declaration_for_property (location_t location, tree interfac
type_of_ivar, -5, NULL_TREE)))
{
location_t original_location = DECL_SOURCE_LOCATION (ivar);
-
+
error_at (location, "property %qs is using instance variable %qs of incompatible type",
IDENTIFIER_POINTER (property_name),
IDENTIFIER_POINTER (ivar_name));
-
+
if (original_location != UNKNOWN_LOCATION)
inform (original_location, "originally specified here");
}
@@ -7656,11 +7656,11 @@ objc_add_synthesize_declaration_for_property (location_t location, tree interfac
if (PROPERTY_ASSIGN_SEMANTICS (property) != OBJC_PROPERTY_ASSIGN)
{
location_t original_location = DECL_SOURCE_LOCATION (ivar);
-
+
error_at (location, "'assign' property %qs is using bit-field instance variable %qs",
IDENTIFIER_POINTER (property_name),
IDENTIFIER_POINTER (ivar_name));
-
+
if (original_location != UNKNOWN_LOCATION)
inform (original_location, "originally specified here");
return;
@@ -7669,11 +7669,11 @@ objc_add_synthesize_declaration_for_property (location_t location, tree interfac
if (!PROPERTY_NONATOMIC (property))
{
location_t original_location = DECL_SOURCE_LOCATION (ivar);
-
+
error_at (location, "'atomic' property %qs is using bit-field instance variable %qs",
IDENTIFIER_POINTER (property_name),
IDENTIFIER_POINTER (ivar_name));
-
+
if (original_location != UNKNOWN_LOCATION)
inform (original_location, "originally specified here");
return;
@@ -7687,14 +7687,14 @@ objc_add_synthesize_declaration_for_property (location_t location, tree interfac
if (PROPERTY_IVAR_NAME (x) == ivar_name)
{
location_t original_location = DECL_SOURCE_LOCATION (x);
-
+
error_at (location, "property %qs is using the same instance variable as property %qs",
IDENTIFIER_POINTER (property_name),
IDENTIFIER_POINTER (PROPERTY_NAME (x)));
-
+
if (original_location != UNKNOWN_LOCATION)
inform (original_location, "originally specified here");
-
+
/* We keep going on. This won't cause the compiler to fail;
the failure would most likely be at runtime. */
}
@@ -7703,7 +7703,7 @@ objc_add_synthesize_declaration_for_property (location_t location, tree interfac
PROPERTY_IVAR_NAME to a non-NULL_TREE. You can recognize a
@synthesize by that. */
PROPERTY_IVAR_NAME (property) = ivar_name;
-
+
/* PROPERTY_SETTER_NAME and PROPERTY_GETTER_NAME are copied from the
original declaration; they are always set (with the exception of
PROPERTY_SETTER_NAME not being set if PROPERTY_READONLY == 1). */
@@ -7754,7 +7754,7 @@ objc_add_synthesize_declaration (location_t location, tree property_and_ivar_lis
if (!interface)
{
/* I can't see how this could happen, but it is good as a safety check. */
- error_at (location,
+ error_at (location,
"%<@synthesize%> requires the @interface of the class to be available");
return;
}
@@ -7762,7 +7762,7 @@ objc_add_synthesize_declaration (location_t location, tree property_and_ivar_lis
/* Now, iterate over the properties and do each of them. */
for (chain = property_and_ivar_list; chain; chain = TREE_CHAIN (chain))
{
- objc_add_synthesize_declaration_for_property (location, interface, TREE_VALUE (chain),
+ objc_add_synthesize_declaration_for_property (location, interface, TREE_VALUE (chain),
TREE_PURPOSE (chain));
}
}
@@ -7783,9 +7783,9 @@ objc_add_dynamic_declaration_for_property (location_t location, tree interface,
if (PROPERTY_NAME (property) == property_name)
{
location_t original_location = DECL_SOURCE_LOCATION (property);
-
+
if (PROPERTY_DYNAMIC (property))
- error_at (location, "property %qs already specified in %<@dynamic%>",
+ error_at (location, "property %qs already specified in %<@dynamic%>",
IDENTIFIER_POINTER (property_name));
else
error_at (location, "property %qs already specified in %<@synthesize%>",
@@ -7860,7 +7860,7 @@ objc_add_dynamic_declaration (location_t location, tree property_list)
interface = lookup_interface (CLASS_NAME (objc_implementation_context));
break;
case CATEGORY_IMPLEMENTATION_TYPE:
- interface = lookup_category (implementation_template,
+ interface = lookup_category (implementation_template,
CLASS_SUPER_NAME (objc_implementation_context));
break;
default:
@@ -7882,7 +7882,7 @@ objc_add_dynamic_declaration (location_t location, tree property_list)
}
}
-/* Main routine to generate code/data for all the property information for
+/* Main routine to generate code/data for all the property information for
current implementation (class or category). CLASS is the interface where
ivars are declared. CLASS_METHODS is where methods are found which
could be a class or a category depending on whether we are implementing
@@ -7898,12 +7898,12 @@ objc_gen_property_data (tree klass, tree class_methods)
/* @dynamic property - nothing to check or synthesize. */
if (PROPERTY_DYNAMIC (x))
continue;
-
+
/* @synthesize property - need to synthesize the accessors. */
if (PROPERTY_IVAR_NAME (x))
{
objc_synthesize_getter (klass, class_methods, x);
-
+
if (PROPERTY_READONLY (x) == 0)
objc_synthesize_setter (klass, class_methods, x);
@@ -7924,7 +7924,7 @@ finish_class (tree klass)
case CLASS_IMPLEMENTATION_TYPE:
{
/* All metadata generation is done in runtime.generate_metadata(). */
-
+
/* Generate what needed for property; setters, getters, etc. */
objc_gen_property_data (implementation_template, implementation_template);
@@ -7946,7 +7946,7 @@ finish_class (tree klass)
case CATEGORY_IMPLEMENTATION_TYPE:
{
tree category = lookup_category (implementation_template, CLASS_SUPER_NAME (klass));
-
+
if (category)
{
/* Generate what needed for property; setters, getters, etc. */
@@ -7957,7 +7957,7 @@ finish_class (tree klass)
objc_implementation_context, '+');
check_methods (CLASS_NST_METHODS (category),
objc_implementation_context, '-');
-
+
if (CLASS_PROTOCOL_LIST (category))
check_protocols (CLASS_PROTOCOL_LIST (category),
"category",
@@ -7977,7 +7977,7 @@ finish_class (tree klass)
and if not, we declare one ourselves. */
tree getter_decl = lookup_method (CLASS_NST_METHODS (klass),
PROPERTY_GETTER_NAME (x));
-
+
if (getter_decl)
{
/* TODO: Check that the declaration is consistent with the property. */
@@ -7990,8 +7990,8 @@ finish_class (tree klass)
will be of the form
-(type)property_getter_name; */
tree rettype = build_tree_list (NULL_TREE, TREE_TYPE (x));
- getter_decl = build_method_decl (INSTANCE_METHOD_DECL,
- rettype, PROPERTY_GETTER_NAME (x),
+ getter_decl = build_method_decl (INSTANCE_METHOD_DECL,
+ rettype, PROPERTY_GETTER_NAME (x),
NULL_TREE, false);
if (PROPERTY_OPTIONAL (x))
objc_add_method (objc_interface_context, getter_decl, false, true);
@@ -8005,9 +8005,9 @@ finish_class (tree klass)
{
/* Now we check that the appropriate setter is declared,
and if not, we declare on ourselves. */
- tree setter_decl = lookup_method (CLASS_NST_METHODS (klass),
+ tree setter_decl = lookup_method (CLASS_NST_METHODS (klass),
PROPERTY_SETTER_NAME (x));
-
+
if (setter_decl)
{
/* TODO: Check that the declaration is consistent with the property. */
@@ -8025,7 +8025,7 @@ finish_class (tree klass)
size_t length = strlen (full_setter_name);
char *setter_name = (char *) alloca (length);
tree ret_type, selector, arg_type, arg_name;
-
+
strcpy (setter_name, full_setter_name);
setter_name[length - 1] = '\0';
ret_type = build_tree_list (NULL_TREE, void_type_node);
@@ -8033,7 +8033,7 @@ finish_class (tree klass)
arg_name = get_identifier ("_value");
selector = objc_build_keyword_decl (get_identifier (setter_name),
arg_type, arg_name, NULL);
- setter_decl = build_method_decl (INSTANCE_METHOD_DECL,
+ setter_decl = build_method_decl (INSTANCE_METHOD_DECL,
ret_type, selector,
build_tree_list (NULL_TREE, NULL_TREE),
false);
@@ -8043,7 +8043,7 @@ finish_class (tree klass)
objc_add_method (objc_interface_context, setter_decl, false, false);
TREE_DEPRECATED (setter_decl) = TREE_DEPRECATED (x);
METHOD_PROPERTY_CONTEXT (setter_decl) = x;
- }
+ }
}
}
break;
@@ -8100,7 +8100,7 @@ lookup_protocol (tree ident, bool warn_if_deprecated, bool definition_required)
/* It would be nice to use warn_deprecated_use() here, but
we are using TREE_CHAIN (which is supposed to be the
TYPE_STUB_DECL for a TYPE) for something different. */
- warning (OPT_Wdeprecated_declarations, "protocol %qE is deprecated",
+ warning (OPT_Wdeprecated_declarations, "protocol %qE is deprecated",
PROTOCOL_NAME (chain));
}
@@ -8135,7 +8135,7 @@ objc_declare_protocol (tree name, tree attributes)
for (attribute = attributes; attribute; attribute = TREE_CHAIN (attribute))
{
tree name = TREE_PURPOSE (attribute);
-
+
if (is_attribute_p ("deprecated", name))
deprecated = true;
else
@@ -8147,7 +8147,7 @@ objc_declare_protocol (tree name, tree attributes)
/* definition_required */ false) == NULL_TREE)
{
tree protocol = make_node (PROTOCOL_INTERFACE_TYPE);
-
+
TYPE_LANG_SLOT_1 (protocol)
= make_tree_vec (PROTOCOL_LANG_SLOT_ELTS);
PROTOCOL_NAME (protocol) = name;
@@ -8155,7 +8155,7 @@ objc_declare_protocol (tree name, tree attributes)
add_protocol (protocol);
PROTOCOL_DEFINED (protocol) = 0;
PROTOCOL_FORWARD_DECL (protocol) = NULL_TREE;
-
+
if (attributes)
{
/* TODO: Do we need to store the attributes here ? */
@@ -8186,7 +8186,7 @@ start_protocol (enum tree_code code, tree name, tree list, tree attributes)
for (attribute = attributes; attribute; attribute = TREE_CHAIN (attribute))
{
tree name = TREE_PURPOSE (attribute);
-
+
if (is_attribute_p ("deprecated", name))
deprecated = true;
else
@@ -8438,7 +8438,7 @@ objc_types_are_equivalent (tree type1, tree type2)
identical. */
if (type1 == NULL_TREE && type2 == NULL_TREE)
return 1;
-
+
/* If one has protocols, and the other one hasn't, they are not
identical. */
if ((type1 == NULL_TREE && type2 != NULL_TREE)
@@ -8455,11 +8455,11 @@ objc_types_are_equivalent (tree type1, tree type2)
for (t = type2; t; t = TREE_CHAIN (t))
if (!lookup_protocol_in_reflist (type1, TREE_VALUE (t)))
return 0;
-
+
for (t = type1; t; t = TREE_CHAIN (t))
if (!lookup_protocol_in_reflist (type2, TREE_VALUE (t)))
return 0;
-
+
return 1;
}
}
@@ -8516,16 +8516,16 @@ comp_proto_with_proto (tree proto1, tree proto2, int strict)
{
type1 = TREE_VALUE (TREE_TYPE (arg1));
type2 = TREE_VALUE (TREE_TYPE (arg2));
-
+
/* FIXME: Do we need to decay argument types to compare them ? */
type1 = objc_decay_parm_type (type1);
type2 = objc_decay_parm_type (type2);
-
+
if (!objc_types_are_equivalent (type1, type2)
&& (strict || !objc_types_share_size_and_alignment (type1, type2)))
return 0;
}
-
+
/* The loop ends when arg1 or arg2 are NULL. Make sure they are
both NULL. */
if (arg1 != arg2)
@@ -8544,17 +8544,17 @@ comp_proto_with_proto (tree proto1, tree proto2, int strict)
{
type1 = TREE_TYPE (TREE_VALUE (arg1));
type2 = TREE_TYPE (TREE_VALUE (arg2));
-
+
/* FIXME: Do we need to decay argument types to compare them ? */
type1 = objc_decay_parm_type (type1);
type2 = objc_decay_parm_type (type2);
-
+
if (!objc_types_are_equivalent (type1, type2)
&& (strict || !objc_types_share_size_and_alignment (type1, type2)))
return 0;
}
}
-
+
/* The loop ends when arg1 or arg2 are NULL. Make sure they are
both NULL. */
if (arg1 != arg2)
@@ -8768,7 +8768,7 @@ really_start_method (tree method,
if (interface)
objc_add_method (interface, copy_node (method),
- TREE_CODE (method) == CLASS_METHOD_DECL,
+ TREE_CODE (method) == CLASS_METHOD_DECL,
/* is_optional= */ false);
}
}
@@ -8799,7 +8799,7 @@ get_super_receiver (void)
DECL_READ_P (UOBJC_SUPER_decl) = 1;
lang_hooks.decls.pushdecl (UOBJC_SUPER_decl);
finish_decl (UOBJC_SUPER_decl, input_location, NULL_TREE, NULL_TREE,
- NULL_TREE);
+ NULL_TREE);
UOBJC_SUPER_scope = objc_get_current_scope ();
}
@@ -8821,7 +8821,7 @@ get_super_receiver (void)
inst_meth = (TREE_CODE (objc_method_context) == INSTANCE_METHOD_DECL);
if (TREE_CODE (objc_implementation_context) == CLASS_IMPLEMENTATION_TYPE)
- class_expr = (*runtime.get_class_super_ref) (input_location,
+ class_expr = (*runtime.get_class_super_ref) (input_location,
imp_list, inst_meth);
else
/* We have a category. */
@@ -8837,20 +8837,20 @@ get_super_receiver (void)
return error_mark_node;
}
- super_class = (*runtime.get_category_super_ref) (input_location,
+ super_class = (*runtime.get_category_super_ref) (input_location,
imp_list, inst_meth);
- class_expr = build_c_cast (input_location,
+ class_expr = build_c_cast (input_location,
TREE_TYPE (super_expr), super_class);
}
- super_expr = build_modify_expr (input_location, super_expr, NULL_TREE,
+ super_expr = build_modify_expr (input_location, super_expr, NULL_TREE,
NOP_EXPR,
input_location, class_expr, NULL_TREE);
- super_expr_list = build_compound_expr (input_location,
+ super_expr_list = build_compound_expr (input_location,
super_expr_list, super_expr);
- super_expr = build_unary_op (input_location,
+ super_expr = build_unary_op (input_location,
ADDR_EXPR, UOBJC_SUPER_decl, 0);
super_expr_list = build_compound_expr (input_location,
super_expr_list, super_expr);
@@ -8981,7 +8981,7 @@ gen_type_name_0 (tree type)
type = DECL_NAME (type);
strcat (errbuf, TREE_CODE (type) == IDENTIFIER_NODE
- ? IDENTIFIER_POINTER (type)
+ ? IDENTIFIER_POINTER (type)
: "");
/* For 'id' and 'Class', adopted protocols are stored in the pointee. */
@@ -9150,7 +9150,7 @@ objc_pretty_print_method (bool is_class_method,
{
if (category_name)
{
- char *result = XNEWVEC (char, strlen (class_name) + strlen (category_name)
+ char *result = XNEWVEC (char, strlen (class_name) + strlen (category_name)
+ strlen (selector) + 7);
if (is_class_method)
@@ -9170,7 +9170,7 @@ objc_pretty_print_method (bool is_class_method,
else
sprintf (result, "-[%s %s]", class_name, selector);
- return result;
+ return result;
}
}
#endif
@@ -9284,7 +9284,7 @@ objc_demangle (const char *mangled)
is impossible to disambiguate. */
for (; *cp; cp++)
if (*cp == '_')
- *cp = ':';
+ *cp = ':';
}
*cp++ = ']'; /* closing right brace */
*cp++ = 0; /* string terminator */
@@ -9351,8 +9351,8 @@ objc_printable_name (tree decl, int v)
return IDENTIFIER_POINTER (DECL_NAME (decl));
}
-/* Routine is called to issue diagnostic when reference to a private
- ivar is made and no other variable with same name is found in
+/* Routine is called to issue diagnostic when reference to a private
+ ivar is made and no other variable with same name is found in
current scope. */
bool
objc_diagnose_private_ivar (tree id)
@@ -9363,7 +9363,7 @@ objc_diagnose_private_ivar (tree id)
ivar = is_ivar (objc_ivar_chain, id);
if (ivar && is_private (ivar))
{
- error ("instance variable %qs is declared private",
+ error ("instance variable %qs is declared private",
IDENTIFIER_POINTER (id));
return true;
}
@@ -9394,7 +9394,7 @@ objc_lookup_ivar (tree other, tree id)
/* Look up the ivar, but do not use it if it is not accessible. */
ivar = is_ivar (objc_ivar_chain, id);
-
+
if (!ivar || is_private (ivar))
return other;
@@ -9483,7 +9483,7 @@ objc_gimplify_property_ref (tree *expr_p)
}
#endif
gcc_assert (TREE_CODE (call_exp) == CALL_EXPR);
-
+
*expr_p = call_exp;
}
@@ -9516,7 +9516,7 @@ objc_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
is_gimple_val, fb_rvalue);
r1 = gimplify_expr (&OBJ_TYPE_REF_EXPR (*expr_p), pre_p, post_p,
is_gimple_val, fb_rvalue);
-
+
return MIN (r0, r1);
}
break;
@@ -9549,7 +9549,7 @@ objc_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
};
Confusingly enough, NSFastEnumeration is then defined by libraries
- to be the same structure.
+ to be the same structure.
*/
static void
@@ -9558,22 +9558,22 @@ build_fast_enumeration_state_template (void)
tree decls, *chain = NULL;
/* { */
- objc_fast_enumeration_state_template = objc_start_struct (get_identifier
+ objc_fast_enumeration_state_template = objc_start_struct (get_identifier
(TAG_FAST_ENUMERATION_STATE));
/* unsigned long state; */
decls = add_field_decl (long_unsigned_type_node, "state", &chain);
/* id *itemsPtr; */
- add_field_decl (build_pointer_type (objc_object_type),
+ add_field_decl (build_pointer_type (objc_object_type),
"itemsPtr", &chain);
/* unsigned long *mutationsPtr; */
- add_field_decl (build_pointer_type (long_unsigned_type_node),
+ add_field_decl (build_pointer_type (long_unsigned_type_node),
"mutationsPtr", &chain);
/* unsigned long extra[5]; */
- add_field_decl (build_sized_array_type (long_unsigned_type_node, 5),
+ add_field_decl (build_sized_array_type (long_unsigned_type_node, 5),
"extra", &chain);
/* } */
@@ -9594,7 +9594,7 @@ build_fast_enumeration_state_template (void)
'continue').
The syntax is
-
+
for (<object expression> in <collection expression>)
<statements>
@@ -9608,7 +9608,7 @@ build_fast_enumeration_state_template (void)
__objc_foreach_collection = <collection expression>;
__objc_foreach_enum_state = { 0 };
__objc_foreach_batchsize = [__objc_foreach_collection countByEnumeratingWithState: &__objc_foreach_enum_state objects: __objc_foreach_items count: 16];
-
+
if (__objc_foreach_batchsize == 0)
<object expression> = nil;
else
@@ -9639,7 +9639,7 @@ build_fast_enumeration_state_template (void)
the user expects to 'continue' or 'break' the entire foreach loop.
We are provided the labels that 'break' and 'continue' jump to, so
we place them where we want them to jump to when they pick them.
-
+
Optimization TODO: we could cache the IMP of
countByEnumeratingWithState:objects:count:.
*/
@@ -9652,7 +9652,7 @@ build_fast_enumeration_state_template (void)
#endif
void
-objc_finish_foreach_loop (location_t location, tree object_expression, tree collection_expression, tree for_body,
+objc_finish_foreach_loop (location_t location, tree object_expression, tree collection_expression, tree for_body,
tree break_label, tree continue_label)
{
/* A tree representing the __objcFastEnumerationState struct type,
@@ -9736,7 +9736,7 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
if (DECL_ORIGINAL_TYPE (objc_NSFastEnumeration_type))
objc_fast_enumeration_state_type = DECL_ORIGINAL_TYPE (objc_NSFastEnumeration_type);
else
- objc_fast_enumeration_state_type = TREE_TYPE (objc_NSFastEnumeration_type);
+ objc_fast_enumeration_state_type = TREE_TYPE (objc_NSFastEnumeration_type);
}
}
}
@@ -9778,7 +9778,7 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
bind = build3 (BIND_EXPR, void_type_node, objc_foreach_batchsize_decl, NULL, NULL);
SET_EXPR_LOCATION (bind, location);
TREE_SIDE_EFFECTS (bind) = 1;
-
+
/* __objc_foreach_collection = <collection expression>; */
t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_collection_decl, collection_expression);
SET_EXPR_LOCATION (t, location);
@@ -9787,21 +9787,21 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
mark_exp_read (collection_expression);
/* __objc_foreach_enum_state.state = 0; */
- t = build2 (MODIFY_EXPR, void_type_node, objc_build_component_ref (objc_foreach_enum_state_decl,
+ t = build2 (MODIFY_EXPR, void_type_node, objc_build_component_ref (objc_foreach_enum_state_decl,
get_identifier ("state")),
build_int_cst (long_unsigned_type_node, 0));
SET_EXPR_LOCATION (t, location);
append_to_statement_list (t, &BIND_EXPR_BODY (bind));
/* __objc_foreach_enum_state.itemsPtr = NULL; */
- t = build2 (MODIFY_EXPR, void_type_node, objc_build_component_ref (objc_foreach_enum_state_decl,
+ t = build2 (MODIFY_EXPR, void_type_node, objc_build_component_ref (objc_foreach_enum_state_decl,
get_identifier ("itemsPtr")),
null_pointer_node);
SET_EXPR_LOCATION (t, location);
append_to_statement_list (t, &BIND_EXPR_BODY (bind));
/* __objc_foreach_enum_state.mutationsPtr = NULL; */
- t = build2 (MODIFY_EXPR, void_type_node, objc_build_component_ref (objc_foreach_enum_state_decl,
+ t = build2 (MODIFY_EXPR, void_type_node, objc_build_component_ref (objc_foreach_enum_state_decl,
get_identifier ("mutationsPtr")),
null_pointer_node);
SET_EXPR_LOCATION (t, location);
@@ -9815,14 +9815,14 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
for (i = 0; i < 5 ; i++)
{
t = build2 (MODIFY_EXPR, void_type_node,
- build_array_ref (location, objc_build_component_ref (objc_foreach_enum_state_decl,
+ build_array_ref (location, objc_build_component_ref (objc_foreach_enum_state_decl,
get_identifier ("extra")),
build_int_cst (NULL_TREE, i)),
build_int_cst (long_unsigned_type_node, 0));
SET_EXPR_LOCATION (t, location);
append_to_statement_list (t, &BIND_EXPR_BODY (bind));
}
-
+
/* __objc_foreach_batchsize = [__objc_foreach_collection countByEnumeratingWithState: &__objc_foreach_enum_state objects: __objc_foreach_items count: 16]; */
selector_name = get_identifier ("countByEnumeratingWithState:objects:count:");
#ifdef OBJCPLUS
@@ -9855,13 +9855,13 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
append_to_statement_list (t, &BIND_EXPR_BODY (bind));
/* if (__objc_foreach_batchsize == 0) */
- first_if = build3 (COND_EXPR, void_type_node,
+ first_if = build3 (COND_EXPR, void_type_node,
/* Condition. */
- c_fully_fold
- (c_common_truthvalue_conversion
- (location,
+ c_fully_fold
+ (c_common_truthvalue_conversion
+ (location,
build_binary_op (location,
- EQ_EXPR,
+ EQ_EXPR,
objc_foreach_batchsize_decl,
build_int_cst (long_unsigned_type_node, 0), 1)),
false, NULL),
@@ -9892,8 +9892,8 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
TREE_SIDE_EFFECTS (first_else) = 1;
/* __objc_foreach_mutations_pointer = *__objc_foreach_enum_state.mutationsPtr; */
- t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_mutations_pointer_decl,
- build_indirect_ref (location, objc_build_component_ref (objc_foreach_enum_state_decl,
+ t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_mutations_pointer_decl,
+ build_indirect_ref (location, objc_build_component_ref (objc_foreach_enum_state_decl,
get_identifier ("mutationsPtr")),
RO_UNARY_STAR));
SET_EXPR_LOCATION (t, location);
@@ -9901,10 +9901,10 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
/* next_batch: */
next_batch_label_decl = create_artificial_label (location);
- t = build1 (LABEL_EXPR, void_type_node, next_batch_label_decl);
+ t = build1 (LABEL_EXPR, void_type_node, next_batch_label_decl);
SET_EXPR_LOCATION (t, location);
append_to_statement_list (t, &BIND_EXPR_BODY (first_else));
-
+
/* { */
/* unsigned long __objc_foreach_index; */
@@ -9929,17 +9929,17 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
append_to_statement_list (t, &BIND_EXPR_BODY (next_batch_bind));
/* if (__objc_foreach_mutation_pointer != *__objc_foreach_enum_state.mutationsPtr) objc_enumeration_mutation (<collection expression>); */
- t = build3 (COND_EXPR, void_type_node,
+ t = build3 (COND_EXPR, void_type_node,
/* Condition. */
- c_fully_fold
- (c_common_truthvalue_conversion
- (location,
- build_binary_op
+ c_fully_fold
+ (c_common_truthvalue_conversion
+ (location,
+ build_binary_op
(location,
- NE_EXPR,
+ NE_EXPR,
objc_foreach_mutations_pointer_decl,
- build_indirect_ref (location,
- objc_build_component_ref (objc_foreach_enum_state_decl,
+ build_indirect_ref (location,
+ objc_build_component_ref (objc_foreach_enum_state_decl,
get_identifier ("mutationsPtr")),
RO_UNARY_STAR), 1)),
false, NULL),
@@ -9953,8 +9953,8 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
append_to_statement_list (t, &BIND_EXPR_BODY (next_batch_bind));
/* <object expression> = enumState.itemsPtr[__objc_foreach_index]; */
- t = build2 (MODIFY_EXPR, void_type_node, object_expression,
- build_array_ref (location, objc_build_component_ref (objc_foreach_enum_state_decl,
+ t = build2 (MODIFY_EXPR, void_type_node, object_expression,
+ build_array_ref (location, objc_build_component_ref (objc_foreach_enum_state_decl,
get_identifier ("itemsPtr")),
objc_foreach_index_decl));
SET_EXPR_LOCATION (t, location);
@@ -9972,7 +9972,7 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
}
/* __objc_foreach_index++; */
- t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_index_decl,
+ t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_index_decl,
build_binary_op (location,
PLUS_EXPR,
objc_foreach_index_decl,
@@ -9981,13 +9981,13 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
append_to_statement_list (t, &BIND_EXPR_BODY (next_batch_bind));
/* if (__objc_foreach_index < __objc_foreach_batchsize) goto next_object; */
- t = build3 (COND_EXPR, void_type_node,
+ t = build3 (COND_EXPR, void_type_node,
/* Condition. */
- c_fully_fold
- (c_common_truthvalue_conversion
- (location,
+ c_fully_fold
+ (c_common_truthvalue_conversion
+ (location,
build_binary_op (location,
- LT_EXPR,
+ LT_EXPR,
objc_foreach_index_decl,
objc_foreach_batchsize_decl, 1)),
false, NULL),
@@ -9997,7 +9997,7 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
NULL_TREE);
SET_EXPR_LOCATION (t, location);
append_to_statement_list (t, &BIND_EXPR_BODY (next_batch_bind));
-
+
/* __objc_foreach_batchsize = [__objc_foreach_collection countByEnumeratingWithState: &__objc_foreach_enum_state objects: __objc_foreach_items count: 16]; */
#ifdef OBJCPLUS
t = objc_finish_message_expr (objc_foreach_collection_decl, selector_name,
@@ -10023,7 +10023,7 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
(NULL_TREE, build_int_cst (NULL_TREE, 16), NULL_TREE))), NULL);
}
#endif
- t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_batchsize_decl,
+ t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_batchsize_decl,
convert (long_unsigned_type_node, t));
SET_EXPR_LOCATION (t, location);
append_to_statement_list (t, &BIND_EXPR_BODY (next_batch_bind));
@@ -10031,13 +10031,13 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
/* } */
/* if (__objc_foreach_batchsize != 0) goto next_batch; */
- t = build3 (COND_EXPR, void_type_node,
+ t = build3 (COND_EXPR, void_type_node,
/* Condition. */
- c_fully_fold
- (c_common_truthvalue_conversion
- (location,
+ c_fully_fold
+ (c_common_truthvalue_conversion
+ (location,
build_binary_op (location,
- NE_EXPR,
+ NE_EXPR,
objc_foreach_batchsize_decl,
build_int_cst (long_unsigned_type_node, 0), 1)),
false, NULL),
@@ -10092,14 +10092,14 @@ objc_string_ref_type_p (tree strp)
tmv = TYPE_MAIN_VARIANT (TREE_TYPE (strp));
tmv = OBJC_TYPE_NAME (tmv);
return (tmv
- && TREE_CODE (tmv) == IDENTIFIER_NODE
- && IDENTIFIER_POINTER (tmv)
+ && TREE_CODE (tmv) == IDENTIFIER_NODE
+ && IDENTIFIER_POINTER (tmv)
&& !strncmp (IDENTIFIER_POINTER (tmv), "NSString", 8));
}
/* At present the behavior of this is undefined and it does nothing. */
void
-objc_check_format_arg (tree ARG_UNUSED (format_arg),
+objc_check_format_arg (tree ARG_UNUSED (format_arg),
tree ARG_UNUSED (args_list))
{
}
@@ -10254,7 +10254,7 @@ encode_pointer (tree type, int curtype, int format)
/* It appears that "r*" means "const char *" rather than
"char *const". "char *const" is encoded as "*",
which is identical to "char *", so the "const" is
- unfortunately lost. */
+ unfortunately lost. */
if (TYPE_READONLY (pointer_to))
obstack_1grow (&util_obstack, 'r');
}
@@ -10275,7 +10275,7 @@ encode_array (tree type, int curtype, int format)
tree an_int_cst = TYPE_SIZE (type);
tree array_of = TREE_TYPE (type);
char buffer[40];
-
+
if (an_int_cst == NULL)
{
/* We are trying to encode an incomplete array. An incomplete
@@ -10304,7 +10304,7 @@ encode_array (tree type, int curtype, int format)
*/
{
char *enc = obstack_base (&util_obstack) + curtype;
- if (memchr (enc, '=',
+ if (memchr (enc, '=',
obstack_object_size (&util_obstack) - curtype) == NULL)
{
/* We are not inside a struct. Encode the array as a
@@ -10350,7 +10350,7 @@ encode_vector (tree type, int curtype, int format)
sprintf (buffer, "![" HOST_WIDE_INT_PRINT_DEC ",%d",
/* We want to compute the equivalent of sizeof (<vector>).
Code inspired by c_sizeof_or_alignof_type. */
- ((TREE_INT_CST_LOW (TYPE_SIZE_UNIT (type))
+ ((TREE_INT_CST_LOW (TYPE_SIZE_UNIT (type))
/ (TYPE_PRECISION (char_type_node) / BITS_PER_UNIT))),
/* We want to compute the equivalent of __alignof__
(<vector>). Code inspired by
@@ -10435,10 +10435,10 @@ encode_aggregate_within (tree type, int curtype, int format, int left,
*/
char c1 = ob_size > 1 ? *(obstack_next_free (&util_obstack) - 2) : 0;
char c0 = ob_size > 0 ? *(obstack_next_free (&util_obstack) - 1) : 0;
-
+
if (c0 == '^' || (c1 == '^' && c0 == 'r'))
pointed_to = true;
-
+
if (format == OBJC_ENCODE_INLINE_DEFS || generating_instance_variables)
{
if (!pointed_to)
@@ -10647,7 +10647,7 @@ encode_type (tree type, int curtype, int format)
obstack_1grow (&util_obstack, '?');
break;
}
-
+
if (flag_next_runtime)
{
/* Super-kludge. Some ObjC qualifier and type combinations need
@@ -10655,7 +10655,7 @@ encode_type (tree type, int curtype, int format)
if (code == POINTER_TYPE && obstack_object_size (&util_obstack) >= 3)
{
char *enc = obstack_base (&util_obstack) + curtype;
-
+
/* Rewrite "in const" from "nr" to "rn". */
if (curtype >= 1 && !strncmp (enc - 1, "nr", 2))
strncpy (enc - 1, "rn", 2);
@@ -10810,7 +10810,7 @@ objc_v2_encode_prop_attr (tree property)
}
if (PROPERTY_DYNAMIC (property))
- obstack_grow (&util_obstack, ",D", 2);
+ obstack_grow (&util_obstack, ",D", 2);
if (PROPERTY_NONATOMIC (property))
obstack_grow (&util_obstack, ",N", 2);