Deleted Added
full compact
c-pragma.c (117395) c-pragma.c (119256)
1/* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack.
2 Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free

--- 274 unchanged lines hidden (view full) ---

283}
284
285void
286maybe_apply_pragma_weak (decl)
287 tree decl;
288{
289 tree *p, t, id;
290
1/* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack.
2 Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free

--- 274 unchanged lines hidden (view full) ---

283}
284
285void
286maybe_apply_pragma_weak (decl)
287 tree decl;
288{
289 tree *p, t, id;
290
291 /* Copied from the check in set_decl_assembler_name. */
292 if (TREE_CODE (decl) == FUNCTION_DECL
293 || (TREE_CODE (decl) == VAR_DECL
294 && (TREE_STATIC (decl)
295 || DECL_EXTERNAL (decl)
296 || TREE_PUBLIC (decl))))
297 id = DECL_ASSEMBLER_NAME (decl);
298 else
291 /* Avoid asking for DECL_ASSEMBLER_NAME when it's not needed. */
292
293 /* No weak symbols pending, take the short-cut. */
294 if (!pending_weaks)
299 return;
295 return;
296 /* If it's not visible outside this file, it doesn't matter whether
297 it's weak. */
298 if (!DECL_EXTERNAL (decl) && !TREE_PUBLIC (decl))
299 return;
300 /* If it's not a function or a variable, it can't be weak.
301 FIXME: what kinds of things are visible outside this file but
302 aren't functions or variables? Should this be an abort() instead? */
303 if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
304 return;
300
305
306 id = DECL_ASSEMBLER_NAME (decl);
307
301 for (p = &pending_weaks; (t = *p) ; p = &TREE_CHAIN (t))
302 if (id == TREE_PURPOSE (t))
303 {
304 apply_pragma_weak (decl, TREE_VALUE (t));
305 *p = TREE_CHAIN (t);
306 break;
307 }
308}

--- 199 unchanged lines hidden ---
308 for (p = &pending_weaks; (t = *p) ; p = &TREE_CHAIN (t))
309 if (id == TREE_PURPOSE (t))
310 {
311 apply_pragma_weak (decl, TREE_VALUE (t));
312 *p = TREE_CHAIN (t);
313 break;
314 }
315}

--- 199 unchanged lines hidden ---