summaryrefslogtreecommitdiff
path: root/gcc/cp/optimize.c
diff options
context:
space:
mode:
authorpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-04 15:33:51 +0000
committerpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-04 15:33:51 +0000
commit853b76408afac56f049f4720e38b2853d632cc74 (patch)
treec6669d1a536c5ee91ed55f661a6f7a5a2bd88e47 /gcc/cp/optimize.c
parent0f8db1b151885a48c38fbb5acb58e8ac481056b3 (diff)
downloadgcc-853b76408afac56f049f4720e38b2853d632cc74.tar.gz
gcc/
* target-def.h (TARGET_CXX_CDTOR_RETURNS_THIS): Define. (TARGET_CXX): Use it. * target.h (struct gcc_target): Add cdtor_returns_this. * config/arm/arm.c (arm_cxx_cdtor_returns_this): New function. (TARGET_CXX_CDTOR_RETURNS_THIS): Define. * doc/tm.texi: Document TARGET_CXX_CDTOR_RETURNS_THIS. gcc/cp/ * Make-lang.in (cp/semantics.o, cp/optimize.o): Depend on TARGET_H. * cp-tree.h (struct language_function): Rename x_dtor_label to x_cdtor_label. (dtor_label): Rename ... (cdtor_label): ... to this. * decl.c (begin_constructor_body): Remove. (check_special_function_return_type): Maybe change the return type. (grokdeclarator): Pass the class type. (start_preparsed_function): Constructors may need a return label. (finish_constructor_body, finish_destructor_body): Set the return value. (begin_function_body): Don't call begin_constructor_body. (finish_function): Don't warn for constructors or destructors. (implicitly_declare_fn): Maybe change the return type. * optimize.c: Include target.h. (maybe_clone_body): Remap the function result. * semantics.c: Include target.h. (finish_return_stmt): Maybe jump to return label for constructors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85561 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/optimize.c')
-rw-r--r--gcc/cp/optimize.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index b94270eabd6..7ccfaffbf0d 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -34,6 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "varray.h"
#include "params.h"
#include "hashtab.h"
+#include "target.h"
#include "debug.h"
#include "tree-inline.h"
#include "flags.h"
@@ -184,6 +185,13 @@ maybe_clone_body (tree fn)
}
}
+ if (targetm.cxx.cdtor_returns_this ())
+ {
+ parm = DECL_RESULT (fn);
+ clone_parm = DECL_RESULT (clone);
+ splay_tree_insert (decl_map, (splay_tree_key) parm,
+ (splay_tree_value) clone_parm);
+ }
/* Clone the body. */
clone_body (clone, fn, decl_map);