Mercurial > hg > CbC > CbC_gcc
comparison gcc/attribs.c @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | 77e2b8dfacca |
children | f6334be47118 |
comparison
equal
deleted
inserted
replaced
56:3c8a44c06a95 | 63:b7f97abdc517 |
---|---|
1 /* Functions dealing with attribute handling, used by most front ends. | 1 /* Functions dealing with attribute handling, used by most front ends. |
2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, | 2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, |
3 2002, 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. | 3 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 |
4 Free Software Foundation, Inc. | |
4 | 5 |
5 This file is part of GCC. | 6 This file is part of GCC. |
6 | 7 |
7 GCC is free software; you can redistribute it and/or modify it under | 8 GCC is free software; you can redistribute it and/or modify it under |
8 the terms of the GNU General Public License as published by the Free | 9 the terms of the GNU General Public License as published by the Free |
284 tree name = TREE_PURPOSE (a); | 285 tree name = TREE_PURPOSE (a); |
285 tree args = TREE_VALUE (a); | 286 tree args = TREE_VALUE (a); |
286 tree *anode = node; | 287 tree *anode = node; |
287 const struct attribute_spec *spec = lookup_attribute_spec (name); | 288 const struct attribute_spec *spec = lookup_attribute_spec (name); |
288 bool no_add_attrs = 0; | 289 bool no_add_attrs = 0; |
290 int fn_ptr_quals = 0; | |
289 tree fn_ptr_tmp = NULL_TREE; | 291 tree fn_ptr_tmp = NULL_TREE; |
290 | 292 |
291 if (spec == NULL) | 293 if (spec == NULL) |
292 { | 294 { |
293 warning (OPT_Wattributes, "%qE attribute directive ignored", | 295 warning (OPT_Wattributes, "%qE attribute directive ignored", |
351 rebuild the pointer type later. | 353 rebuild the pointer type later. |
352 | 354 |
353 This would all be simpler if attributes were part of the | 355 This would all be simpler if attributes were part of the |
354 declarator, grumble grumble. */ | 356 declarator, grumble grumble. */ |
355 fn_ptr_tmp = TREE_TYPE (*anode); | 357 fn_ptr_tmp = TREE_TYPE (*anode); |
358 fn_ptr_quals = TYPE_QUALS (*anode); | |
356 anode = &fn_ptr_tmp; | 359 anode = &fn_ptr_tmp; |
357 flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE; | 360 flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE; |
358 } | 361 } |
359 else if (flags & (int) ATTR_FLAG_FUNCTION_NEXT) | 362 else if (flags & (int) ATTR_FLAG_FUNCTION_NEXT) |
360 { | 363 { |
447 if (fn_ptr_tmp) | 450 if (fn_ptr_tmp) |
448 { | 451 { |
449 /* Rebuild the function pointer type and put it in the | 452 /* Rebuild the function pointer type and put it in the |
450 appropriate place. */ | 453 appropriate place. */ |
451 fn_ptr_tmp = build_pointer_type (fn_ptr_tmp); | 454 fn_ptr_tmp = build_pointer_type (fn_ptr_tmp); |
455 if (fn_ptr_quals) | |
456 fn_ptr_tmp = build_qualified_type (fn_ptr_tmp, fn_ptr_quals); | |
452 if (DECL_P (*node)) | 457 if (DECL_P (*node)) |
453 TREE_TYPE (*node) = fn_ptr_tmp; | 458 TREE_TYPE (*node) = fn_ptr_tmp; |
454 else | 459 else |
455 { | 460 { |
456 gcc_assert (TREE_CODE (*node) == POINTER_TYPE); | 461 gcc_assert (TREE_CODE (*node) == POINTER_TYPE); |