comparison gcc/attribs.c @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents b7f97abdc517
children 04ced10e8804
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
23 #include "system.h" 23 #include "system.h"
24 #include "coretypes.h" 24 #include "coretypes.h"
25 #include "tm.h" 25 #include "tm.h"
26 #include "tree.h" 26 #include "tree.h"
27 #include "flags.h" 27 #include "flags.h"
28 #include "toplev.h" 28 #include "diagnostic-core.h"
29 #include "output.h"
30 #include "rtl.h"
31 #include "ggc.h" 29 #include "ggc.h"
32 #include "tm_p.h" 30 #include "tm_p.h"
33 #include "cpplib.h" 31 #include "cpplib.h"
34 #include "target.h" 32 #include "target.h"
35 #include "langhooks.h" 33 #include "langhooks.h"
208 } 206 }
209 207
210 /* Return the spec for the attribute named NAME. */ 208 /* Return the spec for the attribute named NAME. */
211 209
212 const struct attribute_spec * 210 const struct attribute_spec *
213 lookup_attribute_spec (tree name) 211 lookup_attribute_spec (const_tree name)
214 { 212 {
215 struct substring attr; 213 struct substring attr;
216 214
217 attr.str = IDENTIFIER_POINTER (name); 215 attr.str = IDENTIFIER_POINTER (name);
218 attr.length = IDENTIFIER_LENGTH (name); 216 attr.length = IDENTIFIER_LENGTH (name);
274 272
275 if (! cur_attr) 273 if (! cur_attr)
276 attributes = tree_cons (get_identifier ("target"), opts, attributes); 274 attributes = tree_cons (get_identifier ("target"), opts, attributes);
277 else 275 else
278 TREE_VALUE (cur_attr) = chainon (opts, TREE_VALUE (cur_attr)); 276 TREE_VALUE (cur_attr) = chainon (opts, TREE_VALUE (cur_attr));
277 }
278
279 /* A "naked" function attribute implies "noinline" and "noclone" for
280 those targets that support it. */
281 if (TREE_CODE (*node) == FUNCTION_DECL
282 && lookup_attribute_spec (get_identifier ("naked"))
283 && lookup_attribute ("naked", attributes) != NULL)
284 {
285 if (lookup_attribute ("noinline", attributes) == NULL)
286 attributes = tree_cons (get_identifier ("noinline"), NULL, attributes);
287
288 if (lookup_attribute ("noclone", attributes) == NULL)
289 attributes = tree_cons (get_identifier ("noclone"), NULL, attributes);
279 } 290 }
280 291
281 targetm.insert_attributes (*node, &attributes); 292 targetm.insert_attributes (*node, &attributes);
282 293
283 for (a = attributes; a; a = TREE_CHAIN (a)) 294 for (a = attributes; a; a = TREE_CHAIN (a))