diff options
author | Mark Elbrecht <snowball3@bigfoot.com> | 2000-09-04 20:38:47 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-09-04 20:38:47 -0400 |
commit | c9672d45dcdb6b6ba564450539c5b46ab8384b2f (patch) | |
tree | aee148dac8d6b6040b8f489c53b0105896312fa8 /gcc/cp/decl.c | |
parent | af7f0fde0bb653e030a04524b65c1b78d2e253db (diff) | |
download | gcc-c9672d45dcdb6b6ba564450539c5b46ab8384b2f.zip gcc-c9672d45dcdb6b6ba564450539c5b46ab8384b2f.tar.gz gcc-c9672d45dcdb6b6ba564450539c5b46ab8384b2f.tar.bz2 |
decl.c (finish_function): Move the code for handling functions marked with the constructor and destructor...
* decl.c (finish_function): Move the code for handling functions
marked with the constructor and destructor attributes inside the
expand_p block.
From-SVN: r36147
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b5627f1..0f4d1c1 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -14510,6 +14510,18 @@ finish_function (flags) note_debug_info_needed (ctype); #endif + /* If this function is marked with the constructor attribute, + add it to the list of functions to be called along with + constructors from static duration objects. */ + if (DECL_STATIC_CONSTRUCTOR (fndecl)) + static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors); + + /* If this function is marked with the destructor attribute, + add it to the list of functions to be called along with + destructors from static duration objects. */ + if (DECL_STATIC_DESTRUCTOR (fndecl)) + static_dtors = tree_cons (NULL_TREE, fndecl, static_dtors); + if (DECL_NAME (DECL_RESULT (fndecl))) returns_value |= can_reach_end; else @@ -14565,11 +14577,6 @@ finish_function (flags) DECL_RTL (t) = DECL_INCOMING_RTL (t) = NULL_RTX; } - if (DECL_STATIC_CONSTRUCTOR (fndecl)) - static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors); - if (DECL_STATIC_DESTRUCTOR (fndecl)) - static_dtors = tree_cons (NULL_TREE, fndecl, static_dtors); - /* Clean up. */ if (! nested) { |