diff options
author | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-04 07:11:05 +0000 |
---|---|---|
committer | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-04 07:11:05 +0000 |
commit | 1f3233d13f58417984cb2239d328b65e8d172744 (patch) | |
tree | 720630adca0f6b357e05c4feb8cbe33d556925ce /gcc/c-pragma.c | |
parent | 0dc11899d8781bca1da5f4421327d61890424808 (diff) | |
download | gcc-1f3233d13f58417984cb2239d328b65e8d172744.tar.gz |
Merge from pch-branch up to tag pch-commit-20020603.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54232 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pragma.c')
-rw-r--r-- | gcc/c-pragma.c | 52 |
1 files changed, 15 insertions, 37 deletions
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c index 1a016b8b220..df9e1bf3c34 100644 --- a/gcc/c-pragma.c +++ b/gcc/c-pragma.c @@ -36,11 +36,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define GCC_BAD(msgid) do { warning (msgid); return; } while (0) #define GCC_BAD2(msgid, arg) do { warning (msgid, arg); return; } while (0) -#ifdef HANDLE_PRAGMA_PACK -static void handle_pragma_pack PARAMS ((cpp_reader *)); - -#ifdef HANDLE_PRAGMA_PACK_PUSH_POP -typedef struct align_stack +typedef struct align_stack GTY(()) { int alignment; unsigned int num_pushes; @@ -48,8 +44,12 @@ typedef struct align_stack struct align_stack * prev; } align_stack; -static struct align_stack * alignment_stack = NULL; +static GTY(()) struct align_stack * alignment_stack; + +#ifdef HANDLE_PRAGMA_PACK +static void handle_pragma_pack PARAMS ((cpp_reader *)); +#ifdef HANDLE_PRAGMA_PACK_PUSH_POP /* If we have a "global" #pragma pack(<n>) in effect when the first #pragma pack(push,<n>) is encountered, this stores the value of maximum_field_alignment in effect. When the final pop_alignment() @@ -61,7 +61,6 @@ static int default_alignment; static void push_alignment PARAMS ((int, tree)); static void pop_alignment PARAMS ((tree)); -static void mark_align_stack PARAMS ((void *)); /* Push an alignment value onto the stack. */ static void @@ -75,7 +74,7 @@ push_alignment (alignment, id) { align_stack * entry; - entry = (align_stack *) xmalloc (sizeof (* entry)); + entry = (align_stack *) ggc_alloc (sizeof (* entry)); entry->alignment = alignment; entry->num_pushes = 1; @@ -137,24 +136,9 @@ pop_alignment (id) else maximum_field_alignment = entry->alignment; - free (alignment_stack); - alignment_stack = entry; } } - -static void -mark_align_stack (p) - void *p; -{ - align_stack *a = *(align_stack **) p; - - while (a) - { - ggc_mark_tree (a->id); - a = a->prev; - } -} #else /* not HANDLE_PRAGMA_PACK_PUSH_POP */ #define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = (ALIGN)) #define push_alignment(ID, N) \ @@ -272,12 +256,12 @@ handle_pragma_pack (dummy) } #endif /* HANDLE_PRAGMA_PACK */ +static GTY(()) tree pending_weaks; + #ifdef HANDLE_PRAGMA_WEAK static void apply_pragma_weak PARAMS ((tree, tree)); static void handle_pragma_weak PARAMS ((cpp_reader *)); -static tree pending_weaks; - static void apply_pragma_weak (decl, value) tree decl, value; @@ -363,11 +347,11 @@ maybe_apply_pragma_weak (decl) } #endif /* HANDLE_PRAGMA_WEAK */ +static GTY(()) tree pending_redefine_extname; + #ifdef HANDLE_PRAGMA_REDEFINE_EXTNAME static void handle_pragma_redefine_extname PARAMS ((cpp_reader *)); -static tree pending_redefine_extname; - /* #pragma redefined_extname oldname newname */ static void handle_pragma_redefine_extname (dummy) @@ -404,11 +388,11 @@ handle_pragma_redefine_extname (dummy) } #endif +static GTY(()) tree pragma_extern_prefix; + #ifdef HANDLE_PRAGMA_EXTERN_PREFIX static void handle_pragma_extern_prefix PARAMS ((cpp_reader *)); -static tree pragma_extern_prefix; - /* #pragma extern_prefix "prefix" */ static void handle_pragma_extern_prefix (dummy) @@ -500,25 +484,19 @@ init_pragma () #endif #ifdef HANDLE_PRAGMA_WEAK cpp_register_pragma (parse_in, 0, "weak", handle_pragma_weak); - ggc_add_tree_root (&pending_weaks, 1); #endif #ifdef HANDLE_PRAGMA_REDEFINE_EXTNAME cpp_register_pragma (parse_in, 0, "redefine_extname", handle_pragma_redefine_extname); - ggc_add_tree_root (&pending_redefine_extname, 1); #endif #ifdef HANDLE_PRAGMA_EXTERN_PREFIX cpp_register_pragma (parse_in, 0, "extern_prefix", handle_pragma_extern_prefix); - ggc_add_tree_root (&pragma_extern_prefix, 1); #endif #ifdef REGISTER_TARGET_PRAGMAS REGISTER_TARGET_PRAGMAS (parse_in); #endif - -#ifdef HANDLE_PRAGMA_PACK_PUSH_POP - ggc_add_root (&alignment_stack, 1, sizeof(alignment_stack), - mark_align_stack); -#endif } + +#include "gt-c-pragma.h" |