c-pragma.c (pending_weak_d, [...]): New.
* c-pragma.c (pending_weak_d, pending_weak): New. (pending_weaks): Change the type to VEC((pending_weak,gc) *. (maybe_apply_pragma_weak, maybe_apply_pending_pragma_weaks, handle_pragma_weak): Update the uses of pending_weaks. From-SVN: r159172
This commit is contained in:
parent
0f590a2d73
commit
18bc5398c1
|
@ -1,3 +1,10 @@
|
||||||
|
2010-05-07 Steven Bosscher <steven@gcc.gnu.org>
|
||||||
|
|
||||||
|
* c-pragma.c (pending_weak_d, pending_weak): New.
|
||||||
|
(pending_weaks): Change the type to VEC((pending_weak,gc) *.
|
||||||
|
(maybe_apply_pragma_weak, maybe_apply_pending_pragma_weaks,
|
||||||
|
handle_pragma_weak): Update the uses of pending_weaks.
|
||||||
|
|
||||||
2010-05-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
2010-05-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
||||||
|
|
||||||
PR documentation/44016
|
PR documentation/44016
|
||||||
|
|
|
@ -244,7 +244,16 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
|
||||||
}
|
}
|
||||||
#endif /* HANDLE_PRAGMA_PACK */
|
#endif /* HANDLE_PRAGMA_PACK */
|
||||||
|
|
||||||
static GTY(()) tree pending_weaks;
|
typedef struct GTY(()) pending_weak_d
|
||||||
|
{
|
||||||
|
tree name;
|
||||||
|
tree value;
|
||||||
|
} pending_weak;
|
||||||
|
|
||||||
|
DEF_VEC_O(pending_weak);
|
||||||
|
DEF_VEC_ALLOC_O(pending_weak,gc);
|
||||||
|
|
||||||
|
static GTY(()) VEC(pending_weak,gc) *pending_weaks;
|
||||||
|
|
||||||
#ifdef HANDLE_PRAGMA_WEAK
|
#ifdef HANDLE_PRAGMA_WEAK
|
||||||
static void apply_pragma_weak (tree, tree);
|
static void apply_pragma_weak (tree, tree);
|
||||||
|
@ -274,7 +283,9 @@ apply_pragma_weak (tree decl, tree value)
|
||||||
void
|
void
|
||||||
maybe_apply_pragma_weak (tree decl)
|
maybe_apply_pragma_weak (tree decl)
|
||||||
{
|
{
|
||||||
tree *p, t, id;
|
tree id;
|
||||||
|
int i;
|
||||||
|
pending_weak *pe;
|
||||||
|
|
||||||
/* Avoid asking for DECL_ASSEMBLER_NAME when it's not needed. */
|
/* Avoid asking for DECL_ASSEMBLER_NAME when it's not needed. */
|
||||||
|
|
||||||
|
@ -293,11 +304,11 @@ maybe_apply_pragma_weak (tree decl)
|
||||||
|
|
||||||
id = DECL_ASSEMBLER_NAME (decl);
|
id = DECL_ASSEMBLER_NAME (decl);
|
||||||
|
|
||||||
for (p = &pending_weaks; (t = *p) ; p = &TREE_CHAIN (t))
|
for (i = 0; VEC_iterate (pending_weak, pending_weaks, i, pe); i++)
|
||||||
if (id == TREE_PURPOSE (t))
|
if (id == pe->name)
|
||||||
{
|
{
|
||||||
apply_pragma_weak (decl, TREE_VALUE (t));
|
apply_pragma_weak (decl, pe->value);
|
||||||
*p = TREE_CHAIN (t);
|
VEC_unordered_remove (pending_weak, pending_weaks, i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,15 +318,16 @@ maybe_apply_pragma_weak (tree decl)
|
||||||
void
|
void
|
||||||
maybe_apply_pending_pragma_weaks (void)
|
maybe_apply_pending_pragma_weaks (void)
|
||||||
{
|
{
|
||||||
tree *p, t, alias_id, id, decl, *next;
|
tree alias_id, id, decl;
|
||||||
|
int i;
|
||||||
|
pending_weak *pe;
|
||||||
|
|
||||||
for (p = &pending_weaks; (t = *p) ; p = next)
|
for (i = 0; VEC_iterate (pending_weak, pending_weaks, i, pe); i++)
|
||||||
{
|
{
|
||||||
next = &TREE_CHAIN (t);
|
alias_id = pe->name;
|
||||||
alias_id = TREE_PURPOSE (t);
|
id = pe->value;
|
||||||
id = TREE_VALUE (t);
|
|
||||||
|
|
||||||
if (TREE_VALUE (t) == NULL)
|
if (id == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
decl = build_decl (UNKNOWN_LOCATION,
|
decl = build_decl (UNKNOWN_LOCATION,
|
||||||
|
@ -359,7 +371,12 @@ handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy))
|
||||||
assemble_alias (decl, value);
|
assemble_alias (decl, value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pending_weaks = tree_cons (name, value, pending_weaks);
|
{
|
||||||
|
pending_weak *pe;
|
||||||
|
pe = VEC_safe_push (pending_weak, gc, pending_weaks, NULL);
|
||||||
|
pe->name = name;
|
||||||
|
pe->value = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue