Index: gcc/cp/Make-lang.in
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/Make-lang.in,v
retrieving revision 1.77.2.7
diff -c -3 -p -r1.77.2.7 Make-lang.in
*** gcc/cp/Make-lang.in	14 Nov 2001 22:33:42 -0000	1.77.2.7
--- gcc/cp/Make-lang.in	6 Nov 2003 00:53:34 -0000
*************** CXX_C_OBJS = c-common.o c-format.o c-pra
*** 98,103 ****
--- 98,104 ----
  # Language-specific object files.
  CXX_OBJS = cp/call.o cp/decl.o cp/errfn.o cp/expr.o cp/pt.o cp/typeck2.o \
   cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parse.o cp/ptree.o cp/rtti.o \
+  cp/xml.o \
   cp/spew.o cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o cp/method.o \
   cp/search.o cp/semantics.o cp/tree.o cp/xref.o cp/repo.o cp/dump.o \
   cp/optimize.o cp/mangle.o
*************** cp/dump.o: cp/dump.c $(CXX_TREE_H) c-dum
*** 276,281 ****
--- 277,283 ----
  cp/optimize.o: cp/optimize.c $(CXX_TREE_H) rtl.h integrate.h insn-config.h \
    input.h $(PARAMS_H)
  cp/mangle.o: cp/mangle.c $(CXX_TREE_H) toplev.h
+ cp/xml.o: cp/xml.c $(CXX_TREE_H) toplev.h
  
  cp/parse.o: cp/parse.c $(CXX_TREE_H) flags.h cp/lex.h except.h output.h \
  	system.h toplev.h $(GGC_H)
Index: gcc/cp/cp-tree.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.572.2.36
diff -c -3 -p -r1.572.2.36 cp-tree.h
*** gcc/cp/cp-tree.h	8 Dec 2001 16:12:51 -0000	1.572.2.36
--- gcc/cp/cp-tree.h	6 Nov 2003 00:53:34 -0000
*************** extern tree mangle_guard_variable       
*** 4586,4591 ****
--- 4586,4602 ----
  /* in dump.c */
  extern int cp_dump_tree                         PARAMS ((dump_info_p, tree));
  
+ /* 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;
+ 
+ /* in xml.c */
+ extern void do_xml_output                       PARAMS((const char *));
+ 
  /* -- end of C++ */
  
  #endif /* not _CP_TREE_H */
Index: gcc/cp/decl2.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.437.2.29
diff -c -3 -p -r1.437.2.29 decl2.c
*** gcc/cp/decl2.c	30 Nov 2001 03:12:42 -0000	1.437.2.29
--- gcc/cp/decl2.c	6 Nov 2003 00:53:35 -0000
*************** int flag_enforce_eh_specs = 1;
*** 440,445 ****
--- 440,453 ----
  
  c_language_kind c_language = clk_cplusplus;
  
+ /* 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;
+ 
  /* Table of language-dependent -f options.
     STRING is the option name.  VARIABLE is the address of the variable.
     ON_VALUE is the value to store in VARIABLE
*************** cxx_decode_option (argc, argv)
*** 601,606 ****
--- 609,630 ----
  	  warning ("-fname-mangling-version is no longer supported");
  	  return 1;
  	}
+       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;
+   	}
        else if (dump_switch_p (p))
  	;
        else 
Index: gcc/cp/lang-options.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/Attic/lang-options.h,v
retrieving revision 1.37.4.4
diff -c -3 -p -r1.37.4.4 lang-options.h
*** gcc/cp/lang-options.h	2 Aug 2001 14:23:12 -0000	1.37.4.4
--- gcc/cp/lang-options.h	6 Nov 2003 00:53:35 -0000
*************** DEFINE_LANG_NAME ("C++")
*** 114,119 ****
--- 114,123 ----
    { "-fweak", 
      N_("Emit common-like symbols as weak symbols") },
    { "-fno-weak", "" },
+   { "-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)" },
    { "-fxref", 
      N_("Emit cross referencing information") },
    { "-fno-xref", "" },
Index: gcc/cp/semantics.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.189.2.19
diff -c -3 -p -r1.189.2.19 semantics.c
*** gcc/cp/semantics.c	31 Jan 2002 22:46:46 -0000	1.189.2.19
--- gcc/cp/semantics.c	6 Nov 2003 00:53:36 -0000
*************** finish_translation_unit ()
*** 1703,1708 ****
--- 1703,1712 ----
    while (current_namespace != global_namespace)
      pop_namespace ();
    finish_file ();
+ 
+   /* Do XML output if output file was given.  */
+   if (flag_xml)
+       do_xml_output (flag_xml);
  }
  
  /* Finish a template type parameter, specified as AGGR IDENTIFIER.
