diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-03 01:37:47 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-03 01:37:47 +0000 |
commit | ddea175e0975535082280cb6c7f48e3d80badd59 (patch) | |
tree | e60e4eb12e074384984174f31e71d89fb02af12b /gcc/cp/decl2.c | |
parent | 8cd32a91e8361655d77f2dc6879f28193cf016e7 (diff) | |
download | gcc-ddea175e0975535082280cb6c7f48e3d80badd59.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index d5125fc61d3..cbc6c23eb9d 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -246,6 +246,11 @@ int flag_optional_diags = 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 `char *'. */ @@ -649,6 +654,13 @@ lang_decode_option (argc, argv) 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; !found && j < sizeof (lang_f_options) / sizeof (lang_f_options[0]); j++) @@ -3721,6 +3733,11 @@ finish_file () 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 (); parse_time -= this_time - start_time; varconst_time += this_time - start_time; |