Commit 9bfa80fb by Richard Henderson Committed by Richard Henderson

dbxout.c: Include expr.h.

        * dbxout.c: Include expr.h.
        (dbxout_global_decl): Don't suppress for DECL_RTL unset.
        (dbxout_symbol): Handle DECL_VALUE_EXPR.
        * Makefile.in (dbxout.o): Add EXPR_H.
cp/
        * cp-tree.def (ALIAS_DECL): Remove.
        * cp-lang.c (cp_init_ts): Remove support for it.
        * error.c (dump_decl): Likewise.
        * name-lookup.c (pushdecl): Likewise.
        * semantics.c (finish_id_expression): Likewise.
        * decl2.c (build_anon_union_vars): Use a VAR_DECL with
        DECL_VALUE_EXPR instead.

From-SVN: r104106
parent e27edcd4
2005-09-09 Richard Henderson <rth@redhat.com>
PR debug/20998
* dbxout.c: Include expr.h.
(dbxout_global_decl): Don't suppress for DECL_RTL unset.
(dbxout_symbol): Handle DECL_VALUE_EXPR.
* Makefile.in (dbxout.o): Add EXPR_H.
2005-09-09 Zdenek Dvorak <dvorakz@suse.cz> 2005-09-09 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/23509 PR tree-optimization/23509
......
...@@ -2103,10 +2103,10 @@ optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ ...@@ -2103,10 +2103,10 @@ optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h \ $(TREE_H) $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h \
$(RECOG_H) reload.h toplev.h $(GGC_H) real.h $(TM_P_H) except.h \ $(RECOG_H) reload.h toplev.h $(GGC_H) real.h $(TM_P_H) except.h \
gt-optabs.h $(BASIC_BLOCK_H) $(TARGET_H) function.h gt-optabs.h $(BASIC_BLOCK_H) $(TARGET_H) function.h
dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \ dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(FLAGS_H) $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h langhooks.h \ $(RTL_H) $(FLAGS_H) $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h \
insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h toplev.h \ langhooks.h insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h \
$(GGC_H) $(OBSTACK_H) gt-dbxout.h toplev.h $(GGC_H) $(OBSTACK_H) $(EXPR_H) gt-dbxout.h
debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.h \ sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.h \
$(TREE_H) $(GGC_H) $(RTL_H) $(REGS_H) $(FLAGS_H) insn-config.h \ $(TREE_H) $(GGC_H) $(RTL_H) $(REGS_H) $(FLAGS_H) insn-config.h \
......
2005-09-09 Richard Henderson <rth@redhat.com>
PR debug/20998
* cp-tree.def (ALIAS_DECL): Remove.
* cp-lang.c (cp_init_ts): Remove support for it.
* error.c (dump_decl): Likewise.
* name-lookup.c (pushdecl): Likewise.
* semantics.c (finish_id_expression): Likewise.
* decl2.c (build_anon_union_vars): Use a VAR_DECL with
DECL_VALUE_EXPR instead.
2005-09-09 Mark Mitchell <mark@codesourcery.com> 2005-09-09 Mark Mitchell <mark@codesourcery.com>
PR c++/22252 PR c++/22252
......
...@@ -117,27 +117,22 @@ cp_init_ts (void) ...@@ -117,27 +117,22 @@ cp_init_ts (void)
tree_contains_struct[NAMESPACE_DECL][TS_DECL_NON_COMMON] = 1; tree_contains_struct[NAMESPACE_DECL][TS_DECL_NON_COMMON] = 1;
tree_contains_struct[USING_DECL][TS_DECL_NON_COMMON] = 1; tree_contains_struct[USING_DECL][TS_DECL_NON_COMMON] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_NON_COMMON] = 1; tree_contains_struct[TEMPLATE_DECL][TS_DECL_NON_COMMON] = 1;
tree_contains_struct[ALIAS_DECL][TS_DECL_NON_COMMON] = 1;
tree_contains_struct[NAMESPACE_DECL][TS_DECL_WITH_VIS] = 1; tree_contains_struct[NAMESPACE_DECL][TS_DECL_WITH_VIS] = 1;
tree_contains_struct[USING_DECL][TS_DECL_WITH_VIS] = 1; tree_contains_struct[USING_DECL][TS_DECL_WITH_VIS] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_WITH_VIS] = 1; tree_contains_struct[TEMPLATE_DECL][TS_DECL_WITH_VIS] = 1;
tree_contains_struct[ALIAS_DECL][TS_DECL_WITH_VIS] = 1;
tree_contains_struct[NAMESPACE_DECL][TS_DECL_WRTL] = 1; tree_contains_struct[NAMESPACE_DECL][TS_DECL_WRTL] = 1;
tree_contains_struct[USING_DECL][TS_DECL_WRTL] = 1; tree_contains_struct[USING_DECL][TS_DECL_WRTL] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_WRTL] = 1; tree_contains_struct[TEMPLATE_DECL][TS_DECL_WRTL] = 1;
tree_contains_struct[ALIAS_DECL][TS_DECL_WRTL] = 1;
tree_contains_struct[NAMESPACE_DECL][TS_DECL_COMMON] = 1; tree_contains_struct[NAMESPACE_DECL][TS_DECL_COMMON] = 1;
tree_contains_struct[USING_DECL][TS_DECL_COMMON] = 1; tree_contains_struct[USING_DECL][TS_DECL_COMMON] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_COMMON] = 1; tree_contains_struct[TEMPLATE_DECL][TS_DECL_COMMON] = 1;
tree_contains_struct[ALIAS_DECL][TS_DECL_COMMON] = 1;
tree_contains_struct[NAMESPACE_DECL][TS_DECL_MINIMAL] = 1; tree_contains_struct[NAMESPACE_DECL][TS_DECL_MINIMAL] = 1;
tree_contains_struct[USING_DECL][TS_DECL_MINIMAL] = 1; tree_contains_struct[USING_DECL][TS_DECL_MINIMAL] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_MINIMAL] = 1; tree_contains_struct[TEMPLATE_DECL][TS_DECL_MINIMAL] = 1;
tree_contains_struct[ALIAS_DECL][TS_DECL_MINIMAL] = 1;
init_shadowed_var_for_decl (); init_shadowed_var_for_decl ();
......
...@@ -87,10 +87,6 @@ DEFTREECODE (THROW_EXPR, "throw_expr", tcc_expression, 1) ...@@ -87,10 +87,6 @@ DEFTREECODE (THROW_EXPR, "throw_expr", tcc_expression, 1)
these to avoid actually creating instances of the empty classes. */ these to avoid actually creating instances of the empty classes. */
DEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", tcc_expression, 0) DEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", tcc_expression, 0)
/* A DECL which is really just a placeholder for an expression. Used to
implement non-class scope anonymous unions. */
DEFTREECODE (ALIAS_DECL, "alias_decl", tcc_declaration, 0)
/* A reference to a member function or member functions from a base /* A reference to a member function or member functions from a base
class. BASELINK_FUNCTIONS gives the FUNCTION_DECL, class. BASELINK_FUNCTIONS gives the FUNCTION_DECL,
TEMPLATE_DECL, OVERLOAD, or TEMPLATE_ID_EXPR corresponding to the TEMPLATE_DECL, OVERLOAD, or TEMPLATE_ID_EXPR corresponding to the
......
...@@ -1057,7 +1057,7 @@ cplus_decl_attributes (tree *decl, tree attributes, int flags) ...@@ -1057,7 +1057,7 @@ cplus_decl_attributes (tree *decl, tree attributes, int flags)
} }
/* Walks through the namespace- or function-scope anonymous union /* Walks through the namespace- or function-scope anonymous union
OBJECT, with the indicated TYPE, building appropriate ALIAS_DECLs. OBJECT, with the indicated TYPE, building appropriate VAR_DECLs.
Returns one of the fields for use in the mangled name. */ Returns one of the fields for use in the mangled name. */
static tree static tree
...@@ -1101,11 +1101,12 @@ build_anon_union_vars (tree type, tree object) ...@@ -1101,11 +1101,12 @@ build_anon_union_vars (tree type, tree object)
if (DECL_NAME (field)) if (DECL_NAME (field))
{ {
decl = build_decl (ALIAS_DECL, DECL_NAME (field), TREE_TYPE (field)); decl = build_decl (VAR_DECL, DECL_NAME (field), TREE_TYPE (field));
DECL_INITIAL (decl) = ref; TREE_PUBLIC (decl) = TREE_PUBLIC (object);
TREE_PUBLIC (decl) = 0; TREE_STATIC (decl) = TREE_PUBLIC (object);
TREE_STATIC (decl) = 0; DECL_EXTERNAL (decl) = DECL_EXTERNAL (object);
DECL_EXTERNAL (decl) = 1; SET_DECL_VALUE_EXPR (decl, ref);
DECL_HAS_VALUE_EXPR_P (decl) = 1;
decl = pushdecl (decl); decl = pushdecl (decl);
} }
else if (ANON_AGGR_TYPE_P (TREE_TYPE (field))) else if (ANON_AGGR_TYPE_P (TREE_TYPE (field)))
......
...@@ -744,7 +744,6 @@ dump_decl (tree t, int flags) ...@@ -744,7 +744,6 @@ dump_decl (tree t, int flags)
/* Else fall through. */ /* Else fall through. */
case FIELD_DECL: case FIELD_DECL:
case PARM_DECL: case PARM_DECL:
case ALIAS_DECL:
dump_simple_decl (t, TREE_TYPE (t), flags); dump_simple_decl (t, TREE_TYPE (t), flags);
break; break;
......
...@@ -831,7 +831,6 @@ pushdecl (tree x) ...@@ -831,7 +831,6 @@ pushdecl (tree x)
&& t != NULL_TREE) && t != NULL_TREE)
&& (TREE_CODE (x) == TYPE_DECL && (TREE_CODE (x) == TYPE_DECL
|| TREE_CODE (x) == VAR_DECL || TREE_CODE (x) == VAR_DECL
|| TREE_CODE (x) == ALIAS_DECL
|| TREE_CODE (x) == NAMESPACE_DECL || TREE_CODE (x) == NAMESPACE_DECL
|| TREE_CODE (x) == CONST_DECL || TREE_CODE (x) == CONST_DECL
|| TREE_CODE (x) == TEMPLATE_DECL)) || TREE_CODE (x) == TEMPLATE_DECL))
......
...@@ -2747,11 +2747,6 @@ finish_id_expression (tree id_expression, ...@@ -2747,11 +2747,6 @@ finish_id_expression (tree id_expression,
decl = convert_from_reference (decl); decl = convert_from_reference (decl);
} }
/* Resolve references to variables of anonymous unions
into COMPONENT_REFs. */
if (TREE_CODE (decl) == ALIAS_DECL)
decl = unshare_expr (DECL_INITIAL (decl));
} }
if (TREE_DEPRECATED (decl)) if (TREE_DEPRECATED (decl))
......
...@@ -89,6 +89,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ...@@ -89,6 +89,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "target.h" #include "target.h"
#include "langhooks.h" #include "langhooks.h"
#include "obstack.h" #include "obstack.h"
#include "expr.h"
#ifdef XCOFF_DEBUGGING_INFO #ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h" #include "xcoffout.h"
...@@ -1319,9 +1320,7 @@ dbxout_function_decl (tree decl) ...@@ -1319,9 +1320,7 @@ dbxout_function_decl (tree decl)
static void static void
dbxout_global_decl (tree decl) dbxout_global_decl (tree decl)
{ {
if (TREE_CODE (decl) == VAR_DECL if (TREE_CODE (decl) == VAR_DECL && !DECL_EXTERNAL (decl))
&& ! DECL_EXTERNAL (decl)
&& DECL_RTL_SET_P (decl)) /* Not necessary? */
{ {
int saved_tree_used = TREE_USED (decl); int saved_tree_used = TREE_USED (decl);
TREE_USED (decl) = 1; TREE_USED (decl) = 1;
...@@ -2337,6 +2336,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) ...@@ -2337,6 +2336,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
tree type = TREE_TYPE (decl); tree type = TREE_TYPE (decl);
tree context = NULL_TREE; tree context = NULL_TREE;
int result = 0; int result = 0;
rtx decl_rtl;
/* "Intercept" dbxout_symbol() calls like we do all debug_hooks. */ /* "Intercept" dbxout_symbol() calls like we do all debug_hooks. */
++debug_nesting; ++debug_nesting;
...@@ -2421,7 +2421,8 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) ...@@ -2421,7 +2421,8 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
break; break;
case FUNCTION_DECL: case FUNCTION_DECL:
if (DECL_RTL (decl) == 0) decl_rtl = DECL_RTL_IF_SET (decl);
if (!decl_rtl)
DBXOUT_DECR_NESTING_AND_RETURN (0); DBXOUT_DECR_NESTING_AND_RETURN (0);
if (DECL_EXTERNAL (decl)) if (DECL_EXTERNAL (decl))
break; break;
...@@ -2432,8 +2433,8 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) ...@@ -2432,8 +2433,8 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
/* Don't mention an inline instance of a nested function. */ /* Don't mention an inline instance of a nested function. */
if (context && DECL_FROM_INLINE (decl)) if (context && DECL_FROM_INLINE (decl))
break; break;
if (!MEM_P (DECL_RTL (decl)) if (!MEM_P (decl_rtl)
|| GET_CODE (XEXP (DECL_RTL (decl), 0)) != SYMBOL_REF) || GET_CODE (XEXP (decl_rtl, 0)) != SYMBOL_REF)
break; break;
dbxout_begin_complex_stabs (); dbxout_begin_complex_stabs ();
...@@ -2457,8 +2458,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) ...@@ -2457,8 +2458,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
stabstr_I (DECL_NAME (context)); stabstr_I (DECL_NAME (context));
} }
dbxout_finish_complex_stabs (decl, N_FUN, XEXP (DECL_RTL (decl), 0), dbxout_finish_complex_stabs (decl, N_FUN, XEXP (decl_rtl, 0), 0, 0);
0, 0);
break; break;
case TYPE_DECL: case TYPE_DECL:
...@@ -2609,14 +2609,25 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) ...@@ -2609,14 +2609,25 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
case RESULT_DECL: case RESULT_DECL:
/* Named return value, treat like a VAR_DECL. */ /* Named return value, treat like a VAR_DECL. */
decl_rtl = DECL_RTL_IF_SET (decl);
goto do_var_decl;
case VAR_DECL: case VAR_DECL:
if (! DECL_RTL_SET_P (decl))
DBXOUT_DECR_NESTING_AND_RETURN (0);
/* Don't mention a variable that is external. /* Don't mention a variable that is external.
Let the file that defines it describe it. */ Let the file that defines it describe it. */
if (DECL_EXTERNAL (decl)) if (DECL_EXTERNAL (decl))
break; break;
if (DECL_HAS_VALUE_EXPR_P (decl))
decl_rtl = expand_expr (DECL_VALUE_EXPR (decl), NULL_RTX, VOIDmode,
EXPAND_INITIALIZER);
else
decl_rtl = DECL_RTL_IF_SET (decl);
do_var_decl:
if (!decl_rtl)
DBXOUT_DECR_NESTING_AND_RETURN (0);
/* If the variable is really a constant /* If the variable is really a constant
and not written in memory, inform the debugger. and not written in memory, inform the debugger.
...@@ -2649,13 +2660,13 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) ...@@ -2649,13 +2660,13 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
} }
/* else it is something we handle like a normal variable. */ /* else it is something we handle like a normal variable. */
SET_DECL_RTL (decl, eliminate_regs (DECL_RTL (decl), 0, NULL_RTX)); decl_rtl = eliminate_regs (decl_rtl, 0, NULL_RTX);
#ifdef LEAF_REG_REMAP #ifdef LEAF_REG_REMAP
if (current_function_uses_only_leaf_regs) if (current_function_uses_only_leaf_regs)
leaf_renumber_regs_insn (DECL_RTL (decl)); leaf_renumber_regs_insn (decl_rtl);
#endif #endif
result = dbxout_symbol_location (decl, type, 0, DECL_RTL (decl)); result = dbxout_symbol_location (decl, type, 0, decl_rtl);
break; break;
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment