~/gcc/gcc/cp
directory. These instructions have been written to work with gcc 3.0.4.
Make-lang.in
:
cp/xml.o
" to the CXX_OBJS
list.
cp/mangle.o: cp/mangle.c $(CXX_TREE_H) toplev.hadd the line
cp/xml.o: cp/xml.c $(CXX_TREE_H) toplev.h
semantics.c
:
Find the finish_translation_unit
function and add these
lines to the end of it:
/* Do XML output if enabled. */ if (flag_xml) do_xml_output (flag_xml);
decl2.c
:
/* Filename for xml dump of translation unit. */ const char* flag_xml = 0; /* Start locations for dump of translation unit. */ const char* flag_xml_start = 0;just above the
lang_f_options[]
table definition.
else if ((option_value = skip_leading_substring (p, "xml="))) { if (*option_value == '\0') error ("no file specified with -fxml"); else flag_xml = option_value; } else if ((option_value = skip_leading_substring (p, "xml-start="))) { if (*option_value == '\0') error ("no location specified with -fxml-start"); else flag_xml_start = option_value; }in
cxx_decode_option
, just above these lines:
else if (dump_switch_p (p)) ;
lang-options.h
:
Add the lines
{ "-fxml=", N_("Enable XML output to a file (use with -fsyntax-only)") }, { "-fno-xml", "" }, { "-fxml-start=", "Specify start locations for XML dump (use with -fxml)" },to the bottom of the "
-f
" part of the list, just after
the { "-fno-xref", "" },
line.
cp-tree.h
:
/* Filename for xml dump of translation unit. */ extern const char* flag_xml; /* Start locations for dump of translation unit. */ extern const char* flag_xml_start; /* Tell xml.c what version of GCC is being built. Format is 0xMMmmpp, where MM is the major version number, mm is the minor version number, and pp is the patch level. Examples: gcc 3.0.4 = 0x030004 gcc 3.2.0 = 0x030200 */ #define GCC_XML_GCC_VERSION 0x030004 /* in xml.c */ extern void do_xml_output PARAMS ((const char *));at the bottom of the file, just above the
/* -- end of C++ */
comment (before #endif
).