Index: gcc/c-common.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.393.2.5
diff -c -3 -p -r1.393.2.5 c-common.c
*** gcc/c-common.c	7 Jun 2003 22:13:24 -0000	1.393.2.5
--- gcc/c-common.c	5 Sep 2003 15:42:48 -0000
*************** int flag_permissive;
*** 568,573 ****
--- 568,582 ----
  
  int flag_enforce_eh_specs = 1;
  
+ /* 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;
+ 
+ 
  /*  The version of the C++ ABI in use.  The following values are
      allowed:
  
Index: gcc/c-common.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/c-common.h,v
retrieving revision 1.164
diff -c -3 -p -r1.164 c-common.h
*** gcc/c-common.h	1 Dec 2002 17:51:44 -0000	1.164
--- gcc/c-common.h	5 Sep 2003 15:42:50 -0000
*************** extern int flag_permissive;
*** 732,737 ****
--- 732,745 ----
  
  extern int flag_enforce_eh_specs;
  
+ /* 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;
+ 
  /*  The version of the C++ ABI in use.  The following values are
      allowed:
  
Index: gcc/c-opts.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/c-opts.c,v
retrieving revision 1.24.6.3
diff -c -3 -p -r1.24.6.3 c-opts.c
*** gcc/c-opts.c	12 Jun 2003 11:58:31 -0000	1.24.6.3
--- gcc/c-opts.c	5 Sep 2003 15:42:52 -0000
*************** static void sanitize_cpp_opts PARAMS ((v
*** 253,258 ****
--- 253,260 ----
    OPT("fvtable-gc",		CL_CXX,   OPT_fvtable_gc)		     \
    OPT("fvtable-thunks",		CL_CXX,   OPT_fvtable_thunks)		     \
    OPT("fweak",			CL_CXX,   OPT_fweak)			     \
+   OPT("fxml-start=",		CL_CXX | CL_JOINED, OPT_fxml_start)	     \
+   OPT("fxml=",			CL_CXX | CL_JOINED, OPT_fxml)		     \
    OPT("fxref",			CL_CXX,   OPT_fxref)			     \
    OPT("gen-decls",		CL_OBJC,  OPT_gen_decls)		     \
    OPT("lang-asm",		CL_C_ONLY, OPT_lang_asm)		     \
*************** c_common_decode_option (argc, argv)
*** 1124,1129 ****
--- 1126,1145 ----
  
      case OPT_fenforce_eh_specs:
        flag_enforce_eh_specs = on;
+       break;
+ 
+     case OPT_fxml:
+       if (*arg == '\0')
+         error ("no file specified with -fxml");
+       else
+         flag_xml = arg;
+       break;
+ 
+     case OPT_fxml_start:
+       if (*arg == '\0')
+         error ("no file specified with -fxml-start");
+       else
+         flag_xml_start = arg;
        break;
  
      case OPT_fexternal_templates:
Index: gcc/cp/Make-lang.in
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/Make-lang.in,v
retrieving revision 1.125.4.6
diff -c -3 -p -r1.125.4.6 Make-lang.in
*** gcc/cp/Make-lang.in	23 Jun 2003 20:31:53 -0000	1.125.4.6
--- gcc/cp/Make-lang.in	5 Sep 2003 15:42:56 -0000
*************** CXX_OBJS = cp/call.o cp/decl.o cp/expr.o
*** 86,92 ****
   cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parse.o cp/ptree.o cp/rtti.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/repo.o cp/dump.o \
!  cp/optimize.o cp/mangle.o cp/cp-lang.o
  
  # Use loose warnings for this front end.
  cp-warn =
--- 86,92 ----
   cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parse.o cp/ptree.o cp/rtti.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/repo.o cp/dump.o \
!  cp/optimize.o cp/mangle.o cp/cp-lang.o cp/xml.o
  
  # Use loose warnings for this front end.
  cp-warn =
*************** cp/dump.o: cp/dump.c $(CXX_TREE_H) tree-
*** 276,281 ****
--- 276,282 ----
  cp/optimize.o: cp/optimize.c $(CXX_TREE_H) rtl.h integrate.h insn-config.h \
    input.h $(PARAMS_H) debug.h tree-inline.h
  cp/mangle.o: cp/mangle.c $(CXX_TREE_H) toplev.h real.h gt-cp-mangle.h $(TM_P_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 \
  	cp/decl.h $(SYSTEM_H) toplev.h $(GGC_H) gt-cp-parse.h
Index: gcc/cp/cp-tree.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.776.2.30
diff -c -3 -p -r1.776.2.30 cp-tree.h
*** gcc/cp/cp-tree.h	25 Jul 2003 00:30:59 -0000	1.776.2.30
--- gcc/cp/cp-tree.h	5 Sep 2003 15:43:06 -0000
*************** extern int walk_namespaces              
*** 3845,3850 ****
--- 3845,3851 ----
  						       void *));
  extern int wrapup_globals_for_namespace         PARAMS ((tree, void *));
  extern tree cp_namespace_decls                  PARAMS ((tree));
+ extern tree cp_namespace_namespaces             PARAMS ((tree));
  extern tree create_implicit_typedef             PARAMS ((tree, tree));
  extern tree maybe_push_decl                     PARAMS ((tree));
  extern tree build_target_expr_with_type         PARAMS ((tree, tree));
*************** extern tree mangle_ref_init_variable    
*** 4484,4489 ****
--- 4485,4506 ----
  
  /* in dump.c */
  extern int cp_dump_tree                         PARAMS ((void *, 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;
+ 
+ /* 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 0x030301
+ 
+ /* in xml.c */
+ extern void do_xml_output                       PARAMS ((const char *));
  
  /* -- end of C++ */
  
Index: gcc/cp/decl.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.965.2.58
diff -c -3 -p -r1.965.2.58 decl.c
*** gcc/cp/decl.c	25 Jul 2003 00:31:00 -0000	1.965.2.58
--- gcc/cp/decl.c	5 Sep 2003 15:43:20 -0000
*************** cp_namespace_decls (ns)
*** 2020,2025 ****
--- 2020,2033 ----
    return NAMESPACE_LEVEL (ns)->names;
  }
  
+ /* Return the namespace declarations that are members of the namespace NS.  */
+ tree
+ cp_namespace_namespaces (ns)
+      tree ns;
+ {
+   return NAMESPACE_LEVEL (ns)->namespaces;
+ }
+ 
  struct walk_globals_data {
    walk_globals_pred p;
    walk_globals_fn f;
Index: gcc/cp/lang-options.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/Attic/lang-options.h,v
retrieving revision 1.43.38.1
diff -c -3 -p -r1.43.38.1 lang-options.h
*** gcc/cp/lang-options.h	29 Apr 2003 14:31:52 -0000	1.43.38.1
--- gcc/cp/lang-options.h	5 Sep 2003 15:43:20 -0000
*************** DEFINE_LANG_NAME ("C++")
*** 117,122 ****
--- 117,126 ----
    { "-fxref", 
      N_("Emit cross referencing information") },
    { "-fno-xref", "" },
+   { "-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)" },
  
    { "-Wreturn-type", 
      N_("Warn about inconsistent return types") },
Index: gcc/cp/semantics.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.282.4.6
diff -c -3 -p -r1.282.4.6 semantics.c
*** gcc/cp/semantics.c	6 Jul 2003 22:02:17 -0000	1.282.4.6
--- gcc/cp/semantics.c	5 Sep 2003 15:43:21 -0000
*************** finish_translation_unit ()
*** 1598,1603 ****
--- 1598,1607 ----
    finish_fname_decls ();
    
    finish_file ();
+   
+   /* Do XML output if enabled.  */
+   if (flag_xml)
+     do_xml_output (flag_xml);
  }
  
  /* Finish a template type parameter, specified as AGGR IDENTIFIER.
