Commit 0d8a2528 by Nicola Pero Committed by Nicola Pero

In gcc/: 2011-04-12 Nicola Pero <nicola.pero@meta-innovation.com>

In gcc/:
2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>

	* c-parser.c (c_lex_one_token): Rewritten conditional used when
	compiling Objective-C to be more efficient.

In gcc/objc/:
2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>

	* objc-act.c (objc_is_class_name, objc_is_id): For efficiency,
	avoid calling identifier_global_value() multiple times.

From-SVN: r172327
parent 06bd234a
2011-04-12 Nicola Pero <nicola.pero@meta-innovation.com>
* c-parser.c (c_lex_one_token): Rewritten conditional used when
compiling Objective-C to be more efficient.
2011-04-12 Axel Freyn <axel-freyn@gmx.de> 2011-04-12 Axel Freyn <axel-freyn@gmx.de>
* opts-common.c (decode_cmdline_options_to_array): Remove variable * opts-common.c (decode_cmdline_options_to_array): Remove variable
......
...@@ -334,8 +334,7 @@ c_lex_one_token (c_parser *parser, c_token *token) ...@@ -334,8 +334,7 @@ c_lex_one_token (c_parser *parser, c_token *token)
variables and typedefs, and hence are shadowed by local variables and typedefs, and hence are shadowed by local
declarations. */ declarations. */
if (objc_interface_decl if (objc_interface_decl
&& (global_bindings_p () && (!objc_force_identifier || global_bindings_p ()))
|| (!objc_force_identifier && !decl)))
{ {
token->value = objc_interface_decl; token->value = objc_interface_decl;
token->id_kind = C_ID_CLASSNAME; token->id_kind = C_ID_CLASSNAME;
......
2011-04-12 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-act.c (objc_is_class_name, objc_is_id): For efficiency,
avoid calling identifier_global_value() multiple times.
2011-04-12 Martin Jambor <mjambor@suse.cz> 2011-04-12 Martin Jambor <mjambor@suse.cz>
* objc-act.c (mark_referenced_methods): Call cgraph_get_create_node * objc-act.c (mark_referenced_methods): Call cgraph_get_create_node
......
...@@ -3411,9 +3411,13 @@ objc_is_class_name (tree ident) ...@@ -3411,9 +3411,13 @@ objc_is_class_name (tree ident)
{ {
hash target; hash target;
if (ident && TREE_CODE (ident) == IDENTIFIER_NODE if (ident && TREE_CODE (ident) == IDENTIFIER_NODE)
&& identifier_global_value (ident)) {
ident = identifier_global_value (ident); tree t = identifier_global_value (ident);
if (t)
ident = t;
}
while (ident && TREE_CODE (ident) == TYPE_DECL && DECL_ORIGINAL_TYPE (ident)) while (ident && TREE_CODE (ident) == TYPE_DECL && DECL_ORIGINAL_TYPE (ident))
ident = OBJC_TYPE_NAME (DECL_ORIGINAL_TYPE (ident)); ident = OBJC_TYPE_NAME (DECL_ORIGINAL_TYPE (ident));
...@@ -3453,9 +3457,12 @@ objc_is_class_name (tree ident) ...@@ -3453,9 +3457,12 @@ objc_is_class_name (tree ident)
tree tree
objc_is_id (tree type) objc_is_id (tree type)
{ {
if (type && TREE_CODE (type) == IDENTIFIER_NODE if (type && TREE_CODE (type) == IDENTIFIER_NODE)
&& identifier_global_value (type)) {
type = identifier_global_value (type); tree t = identifier_global_value (type);
if (t)
type = t;
}
if (type && TREE_CODE (type) == TYPE_DECL) if (type && TREE_CODE (type) == TYPE_DECL)
type = TREE_TYPE (type); type = TREE_TYPE (type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment