summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-27 21:44:21 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-27 21:44:21 +0000
commitcb3582e73cdcb0d283d873e62bb1d1223085f687 (patch)
treece9a63a4cd6c9024f69411c47ca98e056f2dc06a /gcc/cp
parent3f95c6909beb5ba36887def50f7d0421f02196b0 (diff)
downloadgcc-cb3582e73cdcb0d283d873e62bb1d1223085f687.tar.gz
PR debug/37959
* dwarf2out.c (dwarf_attr_name): Handle DW_AT_explicit attribute. (gen_subprogram_die): When a function is explicit, generate the DW_AT_explicit attribute. * langhooks.h (struct lang_hooks_for_decls): Add function_decl_explicit_p langhook. * langhooks-def.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define. (LANG_HOOKS_DECLS): Add LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P. * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define. (cp_function_decl_explicit_p): New prototype. * cp-objcp-common.c (cp_function_decl_explicit_p): New function. * g++.dg/debug/dwarf2/explicit-constructor.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145128 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/cp-objcp-common.c12
-rw-r--r--gcc/cp/cp-objcp-common.h6
3 files changed, 24 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6fcd92a8822..477e84b7fcc 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2009-03-27 Dodji Seketeli <dodji@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/37959
+ * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
+ (cp_function_decl_explicit_p): New prototype.
+ * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
+
2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR c++/38638
diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c
index fefafb1ac7e..daefa2b0d87 100644
--- a/gcc/cp/cp-objcp-common.c
+++ b/gcc/cp/cp-objcp-common.c
@@ -1,5 +1,5 @@
/* Some code common to C++ and ObjC++ front ends.
- Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by Ziemowit Laski <zlaski@apple.com>
This file is part of GCC.
@@ -203,6 +203,16 @@ cxx_staticp (tree arg)
return NULL_TREE;
}
+/* Return true if DECL is explicit member function. */
+
+bool
+cp_function_decl_explicit_p (tree decl)
+{
+ return (decl
+ && FUNCTION_FIRST_USER_PARMTYPE (decl) != void_list_node
+ && DECL_NONCONVERTING_P (decl));
+}
+
/* Stubs to keep c-opts.c happy. */
void
push_file_scope (void)
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index f24107598aa..bda23eb635b 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -1,5 +1,5 @@
/* Language hooks common to C++ and ObjC++ front ends.
- Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by Ziemowit Laski <zlaski@apple.com>
This file is part of GCC.
@@ -26,6 +26,8 @@ along with GCC; see the file COPYING3. If not see
extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
tree, bool);
+extern bool cp_function_decl_explicit_p (tree decl);
+
/* Lang hooks that are shared between C++ and ObjC++ are defined here. Hooks
specific to C++ or ObjC++ go in cp/cp-lang.c and objcp/objcp-lang.c,
respectively. */
@@ -131,6 +133,8 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
#define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset
#undef LANG_HOOKS_GIMPLIFY_EXPR
#define LANG_HOOKS_GIMPLIFY_EXPR cp_gimplify_expr
+#undef LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P
+#define LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P cp_function_decl_explicit_p
#undef LANG_HOOKS_OMP_PREDETERMINED_SHARING
#define LANG_HOOKS_OMP_PREDETERMINED_SHARING cxx_omp_predetermined_sharing
#undef LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR