aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-03-17 18:51:10 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2009-03-17 18:51:10 +0100
commit98381eb4870eb42b220822a8596104b42277bdf5 (patch)
tree5ab1be5d5e3b7f945f926c7a5c43cc8ad41b7ddc /gcc/cp
parenta3f596ba3de6975109c5d3d5900a1693cfebb96d (diff)
downloadgcc-98381eb4870eb42b220822a8596104b42277bdf5.zip
gcc-98381eb4870eb42b220822a8596104b42277bdf5.tar.gz
gcc-98381eb4870eb42b220822a8596104b42277bdf5.tar.bz2
dwarf2out.c (dwarf2out_imported_module_or_decl_1): Allow non-NAMESPACE_DECL IMPORTED_DECL_ASSOCIATED_DECL.
* dwarf2out.c (dwarf2out_imported_module_or_decl_1): Allow non-NAMESPACE_DECL IMPORTED_DECL_ASSOCIATED_DECL. * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs instead of calling imported_module_or_decl debug hook if building_stmt_tree (). * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand is a NAMESPACE_DECL. From-SVN: r144912
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/cp-gimplify.c3
-rw-r--r--gcc/cp/name-lookup.c7
3 files changed, 13 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b015dfa..b25d19b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
2009-03-17 Jakub Jelinek <jakub@redhat.com>
+ * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
+ instead of calling imported_module_or_decl debug hook if
+ building_stmt_tree ().
+ * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
+ is a NAMESPACE_DECL.
+
PR debug/39471
* cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
on IMPORTED_DECL.
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 12d632b..bb12988 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -585,8 +585,7 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
if (block)
{
tree using_directive;
- gcc_assert (TREE_OPERAND (*expr_p,0)
- && NAMESPACE_DECL_CHECK (TREE_OPERAND (*expr_p, 0)));
+ gcc_assert (TREE_OPERAND (*expr_p, 0));
using_directive = make_node (IMPORTED_DECL);
TREE_TYPE (using_directive) = void_type_node;
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index b31742c..eec7c44 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -5386,7 +5386,12 @@ cp_emit_debug_info_for_using (tree t, tree context)
/* FIXME: Handle TEMPLATE_DECLs. */
for (t = OVL_CURRENT (t); t; t = OVL_NEXT (t))
if (TREE_CODE (t) != TEMPLATE_DECL)
- (*debug_hooks->imported_module_or_decl) (t, NULL_TREE, context, false);
+ {
+ if (building_stmt_tree ())
+ add_stmt (build_stmt (USING_STMT, t));
+ else
+ (*debug_hooks->imported_module_or_decl) (t, NULL_TREE, context, false);
+ }
}
#include "gt-cp-name-lookup.h"