Patchwork [06/18] convert the C++ front end to automatic dependencies

login
register
mail settings
Submitter Tom Tromey
Date July 25, 2013, 8:31 p.m.
Message ID <1374784313-2102-7-git-send-email-tromey@redhat.com>
Download mbox | patch
Permalink /patch/261933/
State New
Headers show

Comments

Tom Tromey - July 25, 2013, 8:31 p.m.
This converts the C++ front end.

This renames g++spec.o to cp/g++spec.o for uniformity.
This lets us remove an explicit rule.

This patch does not remove various *_H macros from cp/Make-lang.in.
These are still needed by ObjC++.  They're removed by a later patch.

	* Make-lang.in (g++spec.o): Remove.
	(CFLAGS-cp/g++spec.o): New variable.
	(GXX_OBJS): Reference cp/g++spec.o.
	(cc1plus-checksum.o, cp/lex.o, cp/cp-array-notation.o)
	(cp/cp-lang.o, cp/decl.o, cp/decl2.o, cp/cp-objcp-common.o)
	(cp/typeck2.o, cp/typeck.o, cp/class.o, cp/call.o)
	(cp/friend.o, cp/init.o, cp/method.o, cp/cvt.o, cp/search.o)
	(cp/tree.o, cp/ptree.o, cp/rtti.o, cp/except.o, cp/expr.o)
	(cp/pt.o, cp/error.o, cp/repo.o, cp/semantics.o, cp/dump.o)
	(cp/optimize.o, cp/mangle.o, cp/parser.o, cp/cp-gimplify.o)
	(cp/name-lookup.o, cp/cxx-pretty-print.o): Remove.
---
 gcc/cp/Make-lang.in | 95 ++---------------------------------------------------
 1 file changed, 2 insertions(+), 93 deletions(-)
Gabriel Dos Reis - July 26, 2013, 1:22 a.m.
On Thu, Jul 25, 2013 at 3:31 PM, Tom Tromey <tromey@redhat.com> wrote:
> This converts the C++ front end.
>
> This renames g++spec.o to cp/g++spec.o for uniformity.
> This lets us remove an explicit rule.
>
> This patch does not remove various *_H macros from cp/Make-lang.in.
> These are still needed by ObjC++.  They're removed by a later patch.
>
>         * Make-lang.in (g++spec.o): Remove.
>         (CFLAGS-cp/g++spec.o): New variable.
>         (GXX_OBJS): Reference cp/g++spec.o.
>         (cc1plus-checksum.o, cp/lex.o, cp/cp-array-notation.o)
>         (cp/cp-lang.o, cp/decl.o, cp/decl2.o, cp/cp-objcp-common.o)
>         (cp/typeck2.o, cp/typeck.o, cp/class.o, cp/call.o)
>         (cp/friend.o, cp/init.o, cp/method.o, cp/cvt.o, cp/search.o)
>         (cp/tree.o, cp/ptree.o, cp/rtti.o, cp/except.o, cp/expr.o)
>         (cp/pt.o, cp/error.o, cp/repo.o, cp/semantics.o, cp/dump.o)
>         (cp/optimize.o, cp/mangle.o, cp/parser.o, cp/cp-gimplify.o)
>         (cp/name-lookup.o, cp/cxx-pretty-print.o): Remove.

OK.

-- Gaby

Patch

diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index da8e87b..43b7003 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -51,13 +51,10 @@  c++: cc1plus$(exeext)
 # Tell GNU make to ignore these if they exist.
 .PHONY: c++
 
-g++spec.o: $(srcdir)/cp/g++spec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) \
-    $(CONFIG_H) $(OPTS_H)
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
-		$(INCLUDES) $(srcdir)/cp/g++spec.c
+CFLAGS-cp/g++spec.o += $(DRIVER_DEFINES)
 
 # Create the compiler driver for g++.
-GXX_OBJS = $(GCC_OBJS) g++spec.o
+GXX_OBJS = $(GCC_OBJS) cp/g++spec.o
 xg++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
 	  $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
@@ -96,8 +93,6 @@  cc1plus-checksum.c : build/genchecksum$(build_exeext) checksum-options \
                      checksum-options > cc1plus-checksum.c.tmp &&	   \
 	$(srcdir)/../move-if-change cc1plus-checksum.c.tmp cc1plus-checksum.c
 
-cc1plus-checksum.o : cc1plus-checksum.c $(CONFIG_H) $(SYSTEM_H)
-
 cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS)
 	+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
 	      $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
@@ -261,89 +256,3 @@  CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h $(C_COMMON_H) \
 	$(srcdir)/../include/hashtab.h
 CXX_PARSER_H = tree.h $(CXX_TREE_H) c-family/c-pragma.h cp/parser.h
 CXX_PRETTY_PRINT_H = cp/cxx-pretty-print.h $(C_PRETTY_PRINT_H)
-
-cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
-  $(C_PRAGMA_H) input.h cp/operators.def $(TM_P_H) \
-  c-family/c-objc.h
-cp/cp-array-notation.o: cp/cp-array-notation.c $(CONFIG_H) $(SYSTEM_H) \
-  coretypes.h $(TREE_H) $(CXX_TREE_H) $(DIAGNOSTIC_H) tree-iterator.h vec.h \
-  $(GIMPLE_H) c-family/array-notation-common.o $(C_COMMON_H) 
-cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) debug.h langhooks.h \
-  $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-cp.h gt-cp-cp-lang.h \
-  cp/cp-objcp-common.h $(EXPR_H) $(TARGET_H) $(CXX_PARSER_H)
-cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h \
-  output.h toplev.h $(HASHTAB_H) $(RTL_H) \
-  cp/operators.def $(TM_P_H) $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(C_PRAGMA_H) \
-  debug.h gt-cp-decl.h $(TIMEVAR_H) $(TARGET_H) $(PLUGIN_H) \
-  intl.h tree-iterator.h pointer-set.h $(SPLAY_TREE_H) \
-  c-family/c-objc.h
-cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h \
-  toplev.h $(C_COMMON_H) gt-cp-decl2.h $(CGRAPH_H) \
-  $(C_PRAGMA_H) dumpfile.h intl.h $(TARGET_H) $(GIMPLE_H) pointer-set.h \
-  $(SPLAY_TREE_H) c-family/c-ada-spec.h \
-  c-family/c-objc.h
-cp/cp-objcp-common.o : cp/cp-objcp-common.c $(CONFIG_H) $(SYSTEM_H) \
-  coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) $(C_COMMON_H) \
-  langhooks.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) debug.h \
-  $(CXX_PRETTY_PRINT_H) cp/cp-objcp-common.h gt-cp-cp-objcp-common.h
-cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
-  $(TM_P_H) $(DIAGNOSTIC_CORE_H) gt-cp-typeck2.h $(REAL_H) intl.h
-cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(PARAMS_H) \
-  toplev.h $(DIAGNOSTIC_H) convert.h $(C_COMMON_H) $(TARGET_H) \
-  c-family/c-objc.h
-cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h \
-  $(TARGET_H) convert.h $(CGRAPH_H) dumpfile.h gt-cp-class.h \
-  $(SPLAY_TREE_H) pointer-set.h $(HASH_TABLE_H)
-cp/call.o: cp/call.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h \
-  $(DIAGNOSTIC_CORE_H) intl.h gt-cp-call.h convert.h $(TARGET_H) langhooks.h \
-  $(TIMEVAR_H) c-family/c-objc.h
-cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H)
-cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
-  $(EXCEPT_H) $(TARGET_H)
-cp/method.o: cp/method.c $(CXX_TREE_H) $(TM_H) toplev.h \
-  $(TM_P_H) $(TARGET_H) $(DIAGNOSTIC_H) gt-cp-method.h $(GIMPLE_H) \
-  $(COMMON_TARGET_H)
-cp/cvt.o: cp/cvt.c $(CXX_TREE_H) $(TM_H) cp/decl.h $(FLAGS_H) \
-  convert.h $(TARGET_H) intl.h
-cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h \
-  intl.h
-cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
-  $(TREE_INLINE_H) $(REAL_H) gt-cp-tree.h \
-  $(TARGET_H) debug.h $(CGRAPH_H) $(SPLAY_TREE_H) $(GIMPLE_H) $(HASH_TABLE_H)
-cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H)
-cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) convert.h \
-  $(TARGET_H) $(C_PRAGMA_H) gt-cp-rtti.h intl.h
-cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
-  cp/cfns.h $(TREE_INLINE_H) $(TARGET_H) gt-cp-except.h
-cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(TM_P_H)
-cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/cp-objcp-common.h \
-  toplev.h $(TREE_INLINE_H) pointer-set.h gt-cp-pt.h intl.h \
-  c-family/c-objc.h
-cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_H) \
-  $(FLAGS_H) $(REAL_H) $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H) \
-  tree-diagnostic.h tree-pretty-print.h pointer-set.h c-family/c-objc.h
-cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_CORE_H) \
-  gt-cp-repo.h
-cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) toplev.h \
-  $(FLAGS_H) $(RTL_H) $(TIMEVAR_H) \
-  $(TREE_INLINE_H) $(CGRAPH_H) $(TARGET_H) $(C_COMMON_H) $(GIMPLE_H) \
-  bitmap.h gt-cp-semantics.h c-family/c-objc.h $(HASH_TABLE_H)
-cp/dump.o: cp/dump.c $(CXX_TREE_H) $(TM_H) $(TREE_DUMP_H)
-cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) \
-  input.h $(PARAMS_H) debug.h $(TREE_INLINE_H) $(GIMPLE_H) \
-  $(TARGET_H) tree-iterator.h $(CGRAPH_H) $(DIAGNOSTIC_CORE_H) \
-  dumpfile.h
-cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) $(REAL_H) \
-  gt-cp-mangle.h $(TARGET_H) $(TM_P_H) $(CGRAPH_H)
-cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_CORE_H) \
-  gt-cp-parser.h $(TARGET_H) $(PLUGIN_H) intl.h cp/decl.h \
-  c-family/c-objc.h tree-pretty-print.h $(CXX_PARSER_H) $(TIMEVAR_H)
-cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) $(C_COMMON_H) \
-	$(TM_H) coretypes.h pointer-set.h tree-iterator.h $(SPLAY_TREE_H)
-
-cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
-	$(TM_H) $(CXX_TREE_H) $(TIMEVAR_H) gt-cp-name-lookup.h $(PARAMS_H) \
-	$(DIAGNOSTIC_CORE_H) $(FLAGS_H) debug.h pointer-set.h
-
-cp/cxx-pretty-print.o: cp/cxx-pretty-print.c $(CXX_PRETTY_PRINT_H) \
-  $(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h $(CXX_TREE_H) tree-pretty-print.h