summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-26 11:42:03 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-26 11:42:03 +0000
commitfc3dabd5d23d2b5709d3887b5e040fcd567f2749 (patch)
treee9f1a76e7f06dbff4df1301317efffbb2ccbbfac
parent5be941178910a5c153ea743ef653875455841a28 (diff)
downloadgcc-fc3dabd5d23d2b5709d3887b5e040fcd567f2749.tar.gz
* tree.h (tree_decl_with_vis): Add cxx_constructor, cxx_destructor.
(DECL_CXX_CONSTRUCTOR_P, DECL_CXX_DESTRUCTOR_P): New macros. * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_DESTRUCTOR_P): Use middle-end flag. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201994 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/cp-tree.h10
-rw-r--r--gcc/tree.h18
4 files changed, 33 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bd0cd839b67..f0436be43f0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-26 Jan Hubicka <jh@suse.cz>
+
+ * tree.h (tree_decl_with_vis): Add cxx_constructor, cxx_destructor.
+ (DECL_CXX_CONSTRUCTOR_P, DECL_CXX_DESTRUCTOR_P): New macros.
+
2013-08-26 Joern Rennecke <joern.rennecke@embecosm.com>
* config/i386/i386.c (x86_64_elf_select_section): Put ATTRIBUTE_UNUSED
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c03c98735f8..c110d9193a1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-26 Jan Hubicka <jh@suse.cz>
+
+ * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_DESTRUCTOR_P): Use
+ middle-end flag.
+
2013-08-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
* cxx-pretty-print.h (cxx_pretty_printer::unary_expression):
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 248c645eb68..61fdf437b70 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -2121,9 +2121,10 @@ struct GTY((variable_size)) lang_decl {
#define SET_DECL_LANGUAGE(NODE, LANGUAGE) \
(DECL_LANG_SPECIFIC (NODE)->u.base.language = (LANGUAGE))
-/* For FUNCTION_DECLs: nonzero means that this function is a constructor. */
+/* For FUNCTION_DECLs and TEMPLATE_DECLs: nonzero means that this function
+ is a constructor. */
#define DECL_CONSTRUCTOR_P(NODE) \
- (LANG_DECL_FN_CHECK (NODE)->constructor_attr)
+ DECL_CXX_CONSTRUCTOR_P (STRIP_TEMPLATE (NODE))
/* Nonzero if NODE (a FUNCTION_DECL) is a constructor for a complete
object. */
@@ -2152,9 +2153,10 @@ struct GTY((variable_size)) lang_decl {
#define DECL_MOVE_CONSTRUCTOR_P(NODE) \
(DECL_CONSTRUCTOR_P (NODE) && move_fn_p (NODE))
-/* Nonzero if NODE is a destructor. */
+/* Nonzero if NODE (a FUNCTION_DECL or TEMPLATE_DECL)
+ is a destructor. */
#define DECL_DESTRUCTOR_P(NODE) \
- (LANG_DECL_FN_CHECK (NODE)->destructor_attr)
+ DECL_CXX_DESTRUCTOR_P (STRIP_TEMPLATE (NODE))
/* Nonzero if NODE (a FUNCTION_DECL) is a destructor, but not the
specialized in-charge constructor, in-charge deleting constructor,
diff --git a/gcc/tree.h b/gcc/tree.h
index 60921281438..1492f6c0fb1 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -3232,8 +3232,12 @@ struct GTY(()) tree_decl_with_vis {
/* Used by C++ only. Might become a generic decl flag. */
unsigned shadowed_for_var_p : 1;
/* Belong to FUNCTION_DECL exclusively. */
+ unsigned cxx_constructor : 1;
+ /* Belong to FUNCTION_DECL exclusively. */
+ unsigned cxx_destructor : 1;
+ /* Belong to FUNCTION_DECL exclusively. */
unsigned final : 1;
- /* 13 unused bits. */
+ /* 11 unused bits. */
};
extern tree decl_debug_expr_lookup (tree);
@@ -3483,6 +3487,18 @@ extern vec<tree, va_gc> **decl_debug_args_insert (tree);
#define DECL_FUNCTION_VERSIONED(NODE)\
(FUNCTION_DECL_CHECK (NODE)->function_decl.versioned_function)
+/* In FUNCTION_DECL, this is set if this function is a C++ constructor.
+ Devirtualization machinery uses this knowledge for determing type of the
+ object constructed. Also we assume that constructor address is not
+ important. */
+#define DECL_CXX_CONSTRUCTOR_P(NODE)\
+ (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.cxx_constructor)
+
+/* In FUNCTION_DECL, this is set if this function is a C++ destructor.
+ Devirtualization machinery uses this to track types in destruction. */
+#define DECL_CXX_DESTRUCTOR_P(NODE)\
+ (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.cxx_destructor)
+
/* In FUNCTION_DECL that represent an virtual method this is set when
the method is final. */
#define DECL_FINAL_P(NODE)\