diff options
author | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-10-01 00:43:27 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-10-01 00:43:27 +0000 |
commit | 2b76013c9a51825a9447cb693c2bb75ed35aa265 (patch) | |
tree | b8a2be7d40a01a5d28174020f20aacf15182a232 /gcc/cp | |
parent | b65fcf051f2d887decd5ffa5bd947c01ff88dc46 (diff) | |
download | gcc-2b76013c9a51825a9447cb693c2bb75ed35aa265.zip gcc-2b76013c9a51825a9447cb693c2bb75ed35aa265.tar.gz gcc-2b76013c9a51825a9447cb693c2bb75ed35aa265.tar.bz2 |
cp-tree.h (lang_decl_flags): Add global_ctor_p and global_dtor_p.
* cp-tree.h (lang_decl_flags): Add global_ctor_p and
global_dtor_p. Add init_priority.
(DECL_ACCESS): Adjust accordingly.
(DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros.
(GLOBAL_INIT_PRIORITY): Likewise.
* decl.c (lang_mark_tree): Adjust accordingly.
(start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P,
and GLOBAL_INIT_PRIORITY.
* dump.c (dequeue_and_dump): Print them.
* ir.texi: Document them.
From-SVN: r29738
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/decl2.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 19a9cf1..b3cdad4 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2811,6 +2811,13 @@ start_objects (method_type, initp) /* Mark this declaration as used to avoid spurious warnings. */ TREE_USED (current_function_decl) = 1; + /* Mark this function as a global constructor or destructor. */ + if (method_type == 'I') + DECL_GLOBAL_CTOR_P (current_function_decl) = 1; + else + DECL_GLOBAL_DTOR_P (current_function_decl) = 1; + GLOBAL_INIT_PRIORITY (current_function_decl) = initp; + body = begin_compound_stmt (/*has_no_scope=*/0); /* We cannot allow these functions to be elided, even if they do not |