diff options
author | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-12 16:45:40 +0000 |
---|---|---|
committer | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-12 16:45:40 +0000 |
commit | 05ca272f7c66b6bcf4384ddc2c3b6e6700735a63 (patch) | |
tree | 353154a340a6269c5f793969b1e6158c9f58ba42 /gcc/objc | |
parent | 6c6c6ebd082c6d5bcebcb2d811704284bdb34491 (diff) | |
download | gcc-05ca272f7c66b6bcf4384ddc2c3b6e6700735a63.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172327 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/objc')
-rw-r--r-- | gcc/objc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 19 |
2 files changed, 18 insertions, 6 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index d91ca29a026..e9e3be6097f 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,8 @@ +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> * objc-act.c (mark_referenced_methods): Call cgraph_get_create_node diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 513da2fe560..dd81fd1a5f5 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -3411,9 +3411,13 @@ objc_is_class_name (tree ident) { hash target; - if (ident && TREE_CODE (ident) == IDENTIFIER_NODE - && identifier_global_value (ident)) - ident = identifier_global_value (ident); + if (ident && TREE_CODE (ident) == IDENTIFIER_NODE) + { + tree t = identifier_global_value (ident); + if (t) + ident = t; + } + while (ident && TREE_CODE (ident) == TYPE_DECL && DECL_ORIGINAL_TYPE (ident)) ident = OBJC_TYPE_NAME (DECL_ORIGINAL_TYPE (ident)); @@ -3453,9 +3457,12 @@ objc_is_class_name (tree ident) tree objc_is_id (tree type) { - if (type && TREE_CODE (type) == IDENTIFIER_NODE - && identifier_global_value (type)) - type = identifier_global_value (type); + if (type && TREE_CODE (type) == IDENTIFIER_NODE) + { + tree t = identifier_global_value (type); + if (t) + type = t; + } if (type && TREE_CODE (type) == TYPE_DECL) type = TREE_TYPE (type); |