Commit f71f87f9 by Mark Mitchell Committed by Mark Mitchell

invoke.texi (-fdump-translation-unit): New option.

	* invoke.texi (-fdump-translation-unit): New option.
	* Make-lang.in (CXX_SRCS): Add dump.c.
	* Makefile.in (CXX_OBJS): Add dump.o.
	(dump.o): New target.
	* cp-tree.h (DECL_CONV_FN_P): Document.
	(DECL_OVERLOADED_OPERATOR_P): New function.
	(TYPE_PTRMEM_CLASS_TYPE): New macro.
	(TYPE_PTRMEM_POINTED_TO_TYPE): Likewise.
	(PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE.
	(ASM_VOLATILE_P): New macro.
	(STMT_LINENO): Likewise.
	(cp_namespace_decls): New function.
	(dump_node_to_file): New function.
	* decl.c (cp_namespace_decls): New function.
	(walk_namespaces_r): Use it.
	(wrapup_globals_for_namespace): Likewise.
	* decl2.c (flag_dump_translation_unit): New variable.
	(lang_decode_option): Handle -fdump-translation-unit.
	(finish_file): If flag_dump_translation_unit is set, dump the
	translation unit.
	* dump.c: New file.
	* lang-options.h: Add -fdump-translation-unit.
	* pt.c (tsubst_template_parms): Robustify.
	(tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P.
	(tsubst_expr): Use STMT_LINENO.
	* semantics.c (finish_asm_stmt): Eliminate duplicate code.  Check
	for invalid cv-qualifiers even while building templates.

From-SVN: r28434
parent 246833ac
Mon Aug 2 18:29:32 1999 Mark Mitchell <mark@codesourcery.com>
* invoke.texi (-fdump-translation-unit): New option.
Mon Aug 2 17:10:24 1999 Mark Mitchell <mark@codesourcery.com> Mon Aug 2 17:10:24 1999 Mark Mitchell <mark@codesourcery.com>
* toplev.h (errorcount): Declare. * toplev.h (errorcount): Declare.
......
1999-08-02 Mark Mitchell <mark@codesourcery.com>
* Make-lang.in (CXX_SRCS): Add dump.c.
* Makefile.in (CXX_OBJS): Add dump.o.
(dump.o): New target.
* cp-tree.h (DECL_CONV_FN_P): Document.
(DECL_OVERLOADED_OPERATOR_P): New function.
(TYPE_PTRMEM_CLASS_TYPE): New macro.
(TYPE_PTRMEM_POINTED_TO_TYPE): Likewise.
(PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE.
(ASM_VOLATILE_P): New macro.
(STMT_LINENO): Likewise.
(cp_namespace_decls): New function.
(dump_node_to_file): New function.
* decl.c (cp_namespace_decls): New function.
(walk_namespaces_r): Use it.
(wrapup_globals_for_namespace): Likewise.
* decl2.c (flag_dump_translation_unit): New variable.
(lang_decode_option): Handle -fdump-translation-unit.
(finish_file): If flag_dump_translation_unit is set, dump the
translation unit.
* dump.c: New file.
* lang-options.h: Add -fdump-translation-unit.
* pt.c (tsubst_template_parms): Robustify.
(tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P.
(tsubst_expr): Use STMT_LINENO.
* semantics.c (finish_asm_stmt): Eliminate duplicate code. Check
for invalid cv-qualifiers even while building templates.
1999-08-02 Richard Henderson <rth@cygnus.com> 1999-08-02 Richard Henderson <rth@cygnus.com>
* call.c: Include defaults.h instead of expr.h. * call.c: Include defaults.h instead of expr.h.
......
...@@ -117,7 +117,8 @@ CXX_SRCS = $(srcdir)/cp/call.c $(srcdir)/cp/decl2.c \ ...@@ -117,7 +117,8 @@ CXX_SRCS = $(srcdir)/cp/call.c $(srcdir)/cp/decl2.c \
$(srcdir)/cp/search.c $(srcdir)/cp/typeck.c $(srcdir)/cp/decl.c \ $(srcdir)/cp/search.c $(srcdir)/cp/typeck.c $(srcdir)/cp/decl.c \
$(srcdir)/cp/error.c $(srcdir)/cp/friend.c $(srcdir)/cp/init.c \ $(srcdir)/cp/error.c $(srcdir)/cp/friend.c $(srcdir)/cp/init.c \
$(srcdir)/cp/parse.y $(srcdir)/cp/sig.c $(srcdir)/cp/typeck2.c \ $(srcdir)/cp/parse.y $(srcdir)/cp/sig.c $(srcdir)/cp/typeck2.c \
$(srcdir)/cp/repo.c $(srcdir)/cp/semantics.c $(srcdir)/cp/repo.c $(srcdir)/cp/semantics.c \
$(srcdir)/cp/dump.c
cc1plus$(exeext): $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o c-pragma.o \ cc1plus$(exeext): $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o c-pragma.o \
$(srcdir)/cp/cp-tree.h $(srcdir)/cp/cp-tree.def $(srcdir)/cp/gxx.gperf hash.o $(srcdir)/cp/cp-tree.h $(srcdir)/cp/cp-tree.def $(srcdir)/cp/gxx.gperf hash.o
......
...@@ -188,7 +188,7 @@ INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir) ...@@ -188,7 +188,7 @@ INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)
CXX_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \ CXX_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \
class.o decl2.o error.o lex.o parse.o ptree.o rtti.o spew.o typeck.o cvt.o \ class.o decl2.o error.o lex.o parse.o ptree.o rtti.o spew.o typeck.o cvt.o \
except.o friend.o init.o method.o search.o semantics.o tree.o xref.o \ except.o friend.o init.o method.o search.o semantics.o tree.o xref.o \
repo.o @extra_cxx_objs@ repo.o dump.o @extra_cxx_objs@
# Language-independent object files. # Language-independent object files.
OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o
...@@ -306,7 +306,7 @@ repo.o : repo.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \ ...@@ -306,7 +306,7 @@ repo.o : repo.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
$(srcdir)/../toplev.h $(srcdir)/../toplev.h
semantics.o: semantics.c $(CONFIG_H) $(CXX_TREE_H) lex.h \ semantics.o: semantics.c $(CONFIG_H) $(CXX_TREE_H) lex.h \
$(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h $(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h
dump.o: dump.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h
# #
# These exist for maintenance purposes. # These exist for maintenance purposes.
......
...@@ -315,7 +315,8 @@ struct tree_srcloc ...@@ -315,7 +315,8 @@ struct tree_srcloc
#define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1(NODE) #define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1(NODE)
/* Nonzero if this identifier is the prefix for a mangled C++ operator name. */ /* Nonzero if this identifier is the prefix for a mangled C++ operator
name. */
#define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2(NODE) #define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2(NODE)
/* Nonzero if this identifier is the name of a type-conversion /* Nonzero if this identifier is the name of a type-conversion
...@@ -1296,9 +1297,14 @@ struct lang_decl ...@@ -1296,9 +1297,14 @@ struct lang_decl
(DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (NODE)) \ (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (NODE)) \
&& DECL_LANGUAGE (NODE) == lang_cplusplus) && DECL_LANGUAGE (NODE) == lang_cplusplus)
/* Non-zero if NODE is a user-defined conversion operator. */
#define DECL_CONV_FN_P(NODE) \ #define DECL_CONV_FN_P(NODE) \
(IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)) && TREE_TYPE (DECL_NAME (NODE))) (IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)) && TREE_TYPE (DECL_NAME (NODE)))
/* Non-zero if NODE is an overloaded operator. */
#define DECL_OVERLOADED_OPERATOR_P(NODE) \
(IDENTIFIER_OPNAME_P (DECL_NAME ((NODE))))
/* For FUNCTION_DECLs: nonzero means that this function is a constructor /* For FUNCTION_DECLs: nonzero means that this function is a constructor
for an object with virtual baseclasses. */ for an object with virtual baseclasses. */
#define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr) #define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr)
...@@ -1857,12 +1863,22 @@ extern int flag_new_for_scope; ...@@ -1857,12 +1863,22 @@ extern int flag_new_for_scope;
#define DELTA2_FROM_PTRMEMFUNC(NODE) delta2_from_ptrmemfunc ((NODE)) #define DELTA2_FROM_PTRMEMFUNC(NODE) delta2_from_ptrmemfunc ((NODE))
#define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE)) #define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE))
/* For a pointer-to-member type of the form `T X::*', this is `X'. */
#define TYPE_PTRMEM_CLASS_TYPE(NODE) \
(TYPE_PTRMEM_P ((NODE)) \
? TYPE_OFFSET_BASETYPE (TREE_TYPE ((NODE))) \
: TYPE_PTRMEMFUNC_OBJECT_TYPE ((NODE)))
/* For a pointer-to-member type of the form `T X::*', this is `T'. */
#define TYPE_PTRMEM_POINTED_TO_TYPE(NODE) \
(TYPE_PTRMEM_P ((NODE)) \
? TREE_TYPE (TREE_TYPE (NODE)) \
: TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE ((NODE))))
/* For a pointer-to-member constant `X::Y' this is the RECORD_TYPE for /* For a pointer-to-member constant `X::Y' this is the RECORD_TYPE for
`X'. */ `X'. */
#define PTRMEM_CST_CLASS(NODE) \ #define PTRMEM_CST_CLASS(NODE) \
(TYPE_PTRMEM_P (TREE_TYPE (NODE)) \ TYPE_PTRMEM_CLASS_TYPE (TREE_TYPE (NODE))
? TYPE_OFFSET_BASETYPE (TREE_TYPE (TREE_TYPE (NODE))) \
: TYPE_PTRMEMFUNC_OBJECT_TYPE (TREE_TYPE (NODE)))
/* For a pointer-to-member constant `X::Y' this is the _DECL for /* For a pointer-to-member constant `X::Y' this is the _DECL for
`Y'. */ `Y'. */
...@@ -2172,6 +2188,14 @@ extern int flag_new_for_scope; ...@@ -2172,6 +2188,14 @@ extern int flag_new_for_scope;
#define ASM_INPUTS(NODE) TREE_OPERAND (NODE, 3) #define ASM_INPUTS(NODE) TREE_OPERAND (NODE, 3)
#define ASM_CLOBBERS(NODE) TREE_OPERAND (NODE, 4) #define ASM_CLOBBERS(NODE) TREE_OPERAND (NODE, 4)
/* Nonzero for an ASM_STMT if the assembly statement is volatile. */
#define ASM_VOLATILE_P(NODE) \
(ASM_CV_QUAL ((NODE)) != NULL_TREE)
/* The line-number at which a statement began. */
#define STMT_LINENO(NODE) \
(TREE_COMPLEXITY ((NODE)))
/* An enumeration of the kind of tags that C++ accepts. */ /* An enumeration of the kind of tags that C++ accepts. */
enum tag_types { record_type, class_type, union_type, enum_type, enum tag_types { record_type, class_type, union_type, enum_type,
signature_type }; signature_type };
...@@ -2990,6 +3014,7 @@ typedef int (*walk_namespaces_fn) PROTO((tree, void *)); ...@@ -2990,6 +3014,7 @@ typedef int (*walk_namespaces_fn) PROTO((tree, void *));
extern int walk_namespaces PROTO((walk_namespaces_fn, extern int walk_namespaces PROTO((walk_namespaces_fn,
void *)); void *));
extern int wrapup_globals_for_namespace PROTO((tree, void *)); extern int wrapup_globals_for_namespace PROTO((tree, void *));
extern tree cp_namespace_decls PROTO((tree));
/* in decl2.c */ /* in decl2.c */
extern int check_java_method PROTO((tree)); extern int check_java_method PROTO((tree));
...@@ -3604,6 +3629,9 @@ extern void GNU_xref_assign PROTO((tree)); ...@@ -3604,6 +3629,9 @@ extern void GNU_xref_assign PROTO((tree));
extern void GNU_xref_hier PROTO((tree, tree, int, int, int)); extern void GNU_xref_hier PROTO((tree, tree, int, int, int));
extern void GNU_xref_member PROTO((tree, tree)); extern void GNU_xref_member PROTO((tree, tree));
/* in dump.c */
extern void dump_node_to_file PROTO ((tree, char *));
/* -- end of C++ */ /* -- end of C++ */
#endif /* not _CP_TREE_H */ #endif /* not _CP_TREE_H */
...@@ -1808,6 +1808,15 @@ sigtable_decl_p (t, data) ...@@ -1808,6 +1808,15 @@ sigtable_decl_p (t, data)
&& IS_SIGNATURE (TREE_TYPE (t))); && IS_SIGNATURE (TREE_TYPE (t)));
} }
/* Return the declarations that are members of the namespace NS. */
tree
cp_namespace_decls (ns)
tree ns;
{
return NAMESPACE_LEVEL (ns)->names;
}
/* Walk all the namespaces contained NAMESPACE, including NAMESPACE /* Walk all the namespaces contained NAMESPACE, including NAMESPACE
itself, calling F for each. The DATA is passed to F as well. */ itself, calling F for each. The DATA is passed to F as well. */
...@@ -1822,7 +1831,7 @@ walk_namespaces_r (namespace, f, data) ...@@ -1822,7 +1831,7 @@ walk_namespaces_r (namespace, f, data)
result |= (*f) (namespace, data); result |= (*f) (namespace, data);
for (current = NAMESPACE_LEVEL (namespace)->names; for (current = cp_namespace_decls (namespace);
current; current;
current = TREE_CHAIN (current)) current = TREE_CHAIN (current))
{ {
...@@ -1921,7 +1930,7 @@ wrapup_globals_for_namespace (namespace, data) ...@@ -1921,7 +1930,7 @@ wrapup_globals_for_namespace (namespace, data)
tree namespace; tree namespace;
void *data; void *data;
{ {
tree globals = NAMESPACE_LEVEL (namespace)->names; tree globals = cp_namespace_decls (namespace);
int len = list_length (globals); int len = list_length (globals);
tree *vec = (tree *) alloca (sizeof (tree) * len); tree *vec = (tree *) alloca (sizeof (tree) * len);
int i; int i;
......
...@@ -246,6 +246,11 @@ int flag_optional_diags = 1; ...@@ -246,6 +246,11 @@ int flag_optional_diags = 1;
int flag_const_strings = 1; int flag_const_strings = 1;
/* If non-NULL, dump the tree structure for the entire translation
unit to this file. */
char *flag_dump_translation_unit = 0;
/* Nonzero means warn about deprecated conversion from string constant to /* Nonzero means warn about deprecated conversion from string constant to
`char *'. */ `char *'. */
...@@ -649,6 +654,13 @@ lang_decode_option (argc, argv) ...@@ -649,6 +654,13 @@ lang_decode_option (argc, argv)
name_mangling_version = name_mangling_version =
read_integral_parameter (p + 22, p - 2, name_mangling_version); read_integral_parameter (p + 22, p - 2, name_mangling_version);
} }
else if (!strncmp (p, "dump-translation-unit-", 22))
{
if (p[22] == '\0')
error ("no file specified with -fdump-translation-unit");
else
flag_dump_translation_unit = p + 22;
}
else for (j = 0; else for (j = 0;
!found && j < sizeof (lang_f_options) / sizeof (lang_f_options[0]); !found && j < sizeof (lang_f_options) / sizeof (lang_f_options[0]);
j++) j++)
...@@ -3721,6 +3733,11 @@ finish_file () ...@@ -3721,6 +3733,11 @@ finish_file ()
finish_repo (); finish_repo ();
/* The entire file is now complete. If requested, dump everything
file. */
if (flag_dump_translation_unit)
dump_node_to_file (global_namespace, flag_dump_translation_unit);
this_time = get_run_time (); this_time = get_run_time ();
parse_time -= this_time - start_time; parse_time -= this_time - start_time;
varconst_time += this_time - start_time; varconst_time += this_time - start_time;
......
This diff is collapsed. Click to expand it.
...@@ -38,6 +38,7 @@ DEFINE_LANG_NAME ("C++") ...@@ -38,6 +38,7 @@ DEFINE_LANG_NAME ("C++")
{ "-fconst-strings", "" }, { "-fconst-strings", "" },
{ "-fno-const-strings", "Make string literals `char[]' instead of `const char[]'" }, { "-fno-const-strings", "Make string literals `char[]' instead of `const char[]'" },
{ "-fdefault-inline", "" }, { "-fdefault-inline", "" },
{ "-fdump-translation-unit-", "Dump the entire translation unit to a file"},
{ "-fno-default-inline", "Do not inline member functions by default"}, { "-fno-default-inline", "Do not inline member functions by default"},
{ "-frtti", "" }, { "-frtti", "" },
{ "-fno-rtti", "Do not generate run time type descriptor information" }, { "-fno-rtti", "Do not generate run time type descriptor information" },
......
...@@ -5307,8 +5307,8 @@ tsubst_template_parms (parms, args, complain) ...@@ -5307,8 +5307,8 @@ tsubst_template_parms (parms, args, complain)
tree args; tree args;
int complain; int complain;
{ {
tree r; tree r = NULL_TREE;
tree* new_parms = &r; tree* new_parms;
for (new_parms = &r; for (new_parms = &r;
TMPL_PARMS_DEPTH (parms) > TMPL_ARGS_DEPTH (args); TMPL_PARMS_DEPTH (parms) > TMPL_ARGS_DEPTH (args);
...@@ -5822,7 +5822,7 @@ tsubst_decl (t, args, type, in_decl) ...@@ -5822,7 +5822,7 @@ tsubst_decl (t, args, type, in_decl)
maybe_retrofit_in_chrg (r); maybe_retrofit_in_chrg (r);
grok_ctor_properties (ctx, r); grok_ctor_properties (ctx, r);
} }
if (IDENTIFIER_OPNAME_P (DECL_NAME (r))) else if (DECL_OVERLOADED_OPERATOR_P (r))
grok_op_properties (r, DECL_VIRTUAL_P (r), DECL_FRIEND_P (r)); grok_op_properties (r, DECL_VIRTUAL_P (r), DECL_FRIEND_P (r));
} }
break; break;
...@@ -7077,13 +7077,13 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7077,13 +7077,13 @@ tsubst_expr (t, args, complain, in_decl)
switch (TREE_CODE (t)) switch (TREE_CODE (t))
{ {
case RETURN_STMT: case RETURN_STMT:
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
finish_return_stmt (tsubst_expr (RETURN_EXPR (t), finish_return_stmt (tsubst_expr (RETURN_EXPR (t),
args, complain, in_decl)); args, complain, in_decl));
break; break;
case EXPR_STMT: case EXPR_STMT:
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
finish_expr_stmt (tsubst_expr (EXPR_STMT_EXPR (t), finish_expr_stmt (tsubst_expr (EXPR_STMT_EXPR (t),
args, complain, in_decl)); args, complain, in_decl));
break; break;
...@@ -7093,7 +7093,7 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7093,7 +7093,7 @@ tsubst_expr (t, args, complain, in_decl)
int i = suspend_momentary (); int i = suspend_momentary ();
tree dcl, init; tree dcl, init;
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
emit_line_note (input_filename, lineno); emit_line_note (input_filename, lineno);
dcl = start_decl dcl = start_decl
(tsubst (TREE_OPERAND (t, 0), args, complain, in_decl), (tsubst (TREE_OPERAND (t, 0), args, complain, in_decl),
...@@ -7109,7 +7109,7 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7109,7 +7109,7 @@ tsubst_expr (t, args, complain, in_decl)
case FOR_STMT: case FOR_STMT:
{ {
tree tmp; tree tmp;
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
begin_for_stmt (); begin_for_stmt ();
for (tmp = FOR_INIT_STMT (t); tmp; tmp = TREE_CHAIN (tmp)) for (tmp = FOR_INIT_STMT (t); tmp; tmp = TREE_CHAIN (tmp))
...@@ -7127,7 +7127,7 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7127,7 +7127,7 @@ tsubst_expr (t, args, complain, in_decl)
case WHILE_STMT: case WHILE_STMT:
{ {
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
begin_while_stmt (); begin_while_stmt ();
finish_while_stmt_cond (tsubst_expr (WHILE_COND (t), finish_while_stmt_cond (tsubst_expr (WHILE_COND (t),
args, complain, in_decl), args, complain, in_decl),
...@@ -7139,7 +7139,7 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7139,7 +7139,7 @@ tsubst_expr (t, args, complain, in_decl)
case DO_STMT: case DO_STMT:
{ {
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
begin_do_stmt (); begin_do_stmt ();
tsubst_expr (DO_BODY (t), args, complain, in_decl); tsubst_expr (DO_BODY (t), args, complain, in_decl);
finish_do_body (NULL_TREE); finish_do_body (NULL_TREE);
...@@ -7153,7 +7153,7 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7153,7 +7153,7 @@ tsubst_expr (t, args, complain, in_decl)
{ {
tree tmp; tree tmp;
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
begin_if_stmt (); begin_if_stmt ();
finish_if_stmt_cond (tsubst_expr (IF_COND (t), finish_if_stmt_cond (tsubst_expr (IF_COND (t),
args, complain, in_decl), args, complain, in_decl),
...@@ -7180,7 +7180,7 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7180,7 +7180,7 @@ tsubst_expr (t, args, complain, in_decl)
{ {
tree substmt; tree substmt;
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
begin_compound_stmt (COMPOUND_STMT_NO_SCOPE (t)); begin_compound_stmt (COMPOUND_STMT_NO_SCOPE (t));
for (substmt = COMPOUND_BODY (t); for (substmt = COMPOUND_BODY (t);
substmt != NULL_TREE; substmt != NULL_TREE;
...@@ -7192,12 +7192,12 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7192,12 +7192,12 @@ tsubst_expr (t, args, complain, in_decl)
break; break;
case BREAK_STMT: case BREAK_STMT:
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
finish_break_stmt (); finish_break_stmt ();
break; break;
case CONTINUE_STMT: case CONTINUE_STMT:
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
finish_continue_stmt (); finish_continue_stmt ();
break; break;
...@@ -7205,7 +7205,7 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7205,7 +7205,7 @@ tsubst_expr (t, args, complain, in_decl)
{ {
tree val, tmp; tree val, tmp;
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
begin_switch_stmt (); begin_switch_stmt ();
val = tsubst_expr (SWITCH_COND (t), args, complain, in_decl); val = tsubst_expr (SWITCH_COND (t), args, complain, in_decl);
finish_switch_cond (val); finish_switch_cond (val);
...@@ -7230,7 +7230,7 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7230,7 +7230,7 @@ tsubst_expr (t, args, complain, in_decl)
break; break;
case GOTO_STMT: case GOTO_STMT:
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
t = GOTO_DESTINATION (t); t = GOTO_DESTINATION (t);
if (TREE_CODE (t) != IDENTIFIER_NODE) if (TREE_CODE (t) != IDENTIFIER_NODE)
/* Computed goto's must be tsubst'd into. On the other hand, /* Computed goto's must be tsubst'd into. On the other hand,
...@@ -7241,7 +7241,7 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7241,7 +7241,7 @@ tsubst_expr (t, args, complain, in_decl)
break; break;
case ASM_STMT: case ASM_STMT:
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
finish_asm_stmt (ASM_CV_QUAL (t), finish_asm_stmt (ASM_CV_QUAL (t),
tsubst_expr (ASM_STRING (t), args, complain, in_decl), tsubst_expr (ASM_STRING (t), args, complain, in_decl),
tsubst_expr (ASM_OUTPUTS (t), args, complain, in_decl), tsubst_expr (ASM_OUTPUTS (t), args, complain, in_decl),
...@@ -7251,7 +7251,7 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7251,7 +7251,7 @@ tsubst_expr (t, args, complain, in_decl)
break; break;
case TRY_BLOCK: case TRY_BLOCK:
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
begin_try_block (); begin_try_block ();
tsubst_expr (TRY_STMTS (t), args, complain, in_decl); tsubst_expr (TRY_STMTS (t), args, complain, in_decl);
finish_try_block (NULL_TREE); finish_try_block (NULL_TREE);
...@@ -7264,7 +7264,7 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7264,7 +7264,7 @@ tsubst_expr (t, args, complain, in_decl)
break; break;
case HANDLER: case HANDLER:
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
begin_handler (); begin_handler ();
if (HANDLER_PARMS (t)) if (HANDLER_PARMS (t))
{ {
...@@ -7281,7 +7281,7 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7281,7 +7281,7 @@ tsubst_expr (t, args, complain, in_decl)
break; break;
case TAG_DEFN: case TAG_DEFN:
lineno = TREE_COMPLEXITY (t); lineno = STMT_LINENO (t);
t = TREE_TYPE (t); t = TREE_TYPE (t);
if (TREE_CODE (t) == ENUMERAL_TYPE) if (TREE_CODE (t) == ENUMERAL_TYPE)
tsubst (t, args, complain, NULL_TREE); tsubst (t, args, complain, NULL_TREE);
......
...@@ -741,6 +741,14 @@ finish_asm_stmt (cv_qualifier, string, output_operands, ...@@ -741,6 +741,14 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
pop_obstacks (); pop_obstacks ();
} }
if (cv_qualifier != NULL_TREE
&& cv_qualifier != ridpointers[(int) RID_VOLATILE])
{
cp_warning ("%s qualifier ignored on asm",
IDENTIFIER_POINTER (cv_qualifier));
cv_qualifier = NULL_TREE;
}
if (processing_template_decl) if (processing_template_decl)
{ {
tree r = build_min_nt (ASM_STMT, cv_qualifier, string, tree r = build_min_nt (ASM_STMT, cv_qualifier, string,
...@@ -756,30 +764,17 @@ finish_asm_stmt (cv_qualifier, string, output_operands, ...@@ -756,30 +764,17 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
{ {
tree t; tree t;
if (cv_qualifier != NULL_TREE
&& cv_qualifier != ridpointers[(int) RID_VOLATILE])
cp_warning ("%s qualifier ignored on asm",
IDENTIFIER_POINTER (cv_qualifier));
for (t = input_operands; t; t = TREE_CHAIN (t)) for (t = input_operands; t; t = TREE_CHAIN (t))
TREE_VALUE (t) = decay_conversion (TREE_VALUE (t)); TREE_VALUE (t) = decay_conversion (TREE_VALUE (t));
c_expand_asm_operands (string, output_operands, c_expand_asm_operands (string, output_operands,
input_operands, input_operands,
clobbers, clobbers,
cv_qualifier cv_qualifier != NULL_TREE,
== ridpointers[(int) RID_VOLATILE],
input_filename, lineno); input_filename, lineno);
} }
else else
{ expand_asm (string);
/* Don't warn about redundant specification of 'volatile' here. */
if (cv_qualifier != NULL_TREE
&& cv_qualifier != ridpointers[(int) RID_VOLATILE])
cp_warning ("%s qualifier ignored on asm",
IDENTIFIER_POINTER (cv_qualifier));
expand_asm (string);
}
finish_stmt (); finish_stmt ();
} }
......
...@@ -139,8 +139,8 @@ in the following sections. ...@@ -139,8 +139,8 @@ in the following sections.
@item Debugging Options @item Debugging Options
@xref{Debugging Options,,Options for Debugging Your Program or GCC}. @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
@smallexample @smallexample
-a -ax -d@var{letters} -fdump-unnumbered -fpretend-float -a -ax -d@var{letters} -fdump-unnumbered -fdump-translation-unit-@var{file}
-fprofile-arcs -ftest-coverage -fpretend-float -fprofile-arcs -ftest-coverage
-g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2 -g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2
-ggdb -gstabs -gstabs+ -gxcoff -gxcoff+ -ggdb -gstabs -gstabs+ -gxcoff -gxcoff+
-p -pg -print-file-name=@var{library} -print-libgcc-file-name -p -pg -print-file-name=@var{library} -print-libgcc-file-name
...@@ -2120,6 +2120,10 @@ numbers and line number note output. This makes it more feasible to ...@@ -2120,6 +2120,10 @@ numbers and line number note output. This makes it more feasible to
use diff on debugging dumps for compiler invokations with different use diff on debugging dumps for compiler invokations with different
options, in particular with and without -g. options, in particular with and without -g.
@item -fdump-translation-unit-@var{file} (C++ only)
Dump a representation of the tree structure for the entire translation
unit to @var{file}.
@item -fpretend-float @item -fpretend-float
When running a cross-compiler, pretend that the target machine uses the When running a cross-compiler, pretend that the target machine uses the
same floating point format as the host machine. This causes incorrect same floating point format as the host machine. This causes incorrect
......
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