From: Tom Tromey <tromey@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: [PATCH v2 18/18] remove unused macros
Date: Mon, 29 Jul 2013 16:25:00 -0000 [thread overview]
Message-ID: <1375115069-31143-19-git-send-email-tromey@redhat.com> (raw)
In-Reply-To: <1375115069-31143-1-git-send-email-tromey@redhat.com>
I used this perl script to find unused _H macros in the Makefile. I
deleted the definitions it reported and re-ran the script, until there
was no more output.
The script also makes note of _H variables which are used but never
defined. That is how I found the TREE_GIMPLE_H use, fixed earlier in
the series.
Once Ada and the various config files are migrated to automatic
dependencies, we can run this script again and remove more things.
================================================================
while (<>) {
chomp;
if (m/^(([A-Z0-9_]+)_H)\s*:?=\s/) {
$saw_def{$1} = $ARGV . ":" . $.;
}
while (m/\$[({](([A-Z0-9_]+)_H)[)}](.*)/) {
$saw_use{$1} = 1;
$_ = $3;
}
} continue {
close ARGV if eof;
}
foreach $key (sort keys %saw_use) {
if (! defined $saw_def{$key}) {
print "use without a def of ", $key, "\n";
}
}
foreach $key (sort keys %saw_def) {
if (! defined $saw_use{$key}) {
print $saw_def{$key}, ": no use of ", $key, "\n";
}
}
================================================================
* Makefile.in (PARTITION_H, LTO_SYMTAB_H, COMMON_TARGET_DEF_H)
(RTL_ERROR_H, TRANS_MEM_H, COVERAGE_H, DEMANGLE_H, ALIAS_H)
(SCHED_INT_H, SEL_SCHED_IR_H, SEL_SCHED_DUMP_H, VALTRACK_H, DDG_H)
(GGC_INTERNAL_H, DECNUM_H, BACKTRACE_H, MKDEPS_H, TREE_HASHER_H)
(TREE_SSA_LIVE_H, SSAEXPAND_H, DWARF2OUT_H, SCEV_H, OMEGA_H)
(TREE_DATA_REF_H, IRA_INT_H, LRA_INT_H, DBGCNT_H, DATA_STREAMER_H)
(GIMPLE_STREAMER_H, TREE_STREAMER_H, STREAMER_HOOKS_H)
(TREE_VECTORIZER_H, IPA_INLINE_H, GSTAB_H, LIBFUNCS_H)
(GRAPHITE_HTAB_H, CONTEXT_H): Remove.
---
gcc/Makefile.in | 47 -----------------------------------------------
1 file changed, 47 deletions(-)
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index a21daba..e6d63d3 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -446,7 +446,6 @@ HASHTAB_H = $(srcdir)/../include/hashtab.h
OBSTACK_H = $(srcdir)/../include/obstack.h
SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h
FIBHEAP_H = $(srcdir)/../include/fibheap.h
-PARTITION_H = $(srcdir)/../include/partition.h
MD5_H = $(srcdir)/../include/md5.h
DWARF2_H = $(srcdir)/../include/dwarf2.h $(srcdir)/../include/dwarf2.def
XREGEX_H = $(srcdir)/../include/xregex.h
@@ -454,7 +453,6 @@ FNMATCH_H = $(srcdir)/../include/fnmatch.h
# Linker plugin API headers
LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
-LTO_SYMTAB_H = $(srcdir)/../include/lto-symtab.h
# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
@@ -863,14 +861,11 @@ LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H)
TARGET_DEF_H = target-def.h target-hooks-def.h $(HOOKS_H) targhooks.h
C_TARGET_DEF_H = c-family/c-target-def.h c-family/c-target-hooks-def.h \
$(TREE_H) $(C_COMMON_H) $(HOOKS_H) common/common-targhooks.h
-COMMON_TARGET_DEF_H = common/common-target-def.h \
- common/common-target-hooks-def.h $(HOOKS_H)
RTL_BASE_H = coretypes.h rtl.h rtl.def $(MACHMODE_H) reg-notes.def \
insn-notes.def $(INPUT_H) $(REAL_H) statistics.h $(VEC_H) \
$(FIXED_VALUE_H) alias.h $(HASHTAB_H)
FIXED_VALUE_H = fixed-value.h $(MACHMODE_H) double-int.h
RTL_H = $(RTL_BASE_H) $(FLAGS_H) genrtl.h
-RTL_ERROR_H = rtl-error.h $(RTL_H) $(DIAGNOSTIC_CORE_H)
READ_MD_H = $(OBSTACK_H) $(HASHTAB_H) read-md.h
PARAMS_H = params.h params.def
BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def \
@@ -888,12 +883,8 @@ BASIC_BLOCK_H = basic-block.h $(PREDICT_H) $(VEC_H) $(FUNCTION_H) \
GIMPLE_H = gimple.h gimple.def gsstruct.def pointer-set.h $(VEC_H) \
$(GGC_H) $(BASIC_BLOCK_H) $(TREE_H) tree-ssa-operands.h \
tree-ssa-alias.h $(INTERNAL_FN_H) $(HASH_TABLE_H)
-TRANS_MEM_H = trans-mem.h
GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h
-COVERAGE_H = coverage.h $(GCOV_IO_H)
-DEMANGLE_H = $(srcdir)/../include/demangle.h
RECOG_H = recog.h
-ALIAS_H = alias.h
EMIT_RTL_H = emit-rtl.h
FLAGS_H = flags.h flag-types.h $(OPTIONS_H)
OPTIONS_H = options.h flag-types.h $(OPTIONS_H_EXTRA)
@@ -902,11 +893,6 @@ FUNCTION_H = function.h $(HASHTAB_H) $(TM_H) hard-reg-set.h \
EXPR_H = expr.h insn-config.h $(FUNCTION_H) $(RTL_H) $(FLAGS_H) $(TREE_H) $(MACHMODE_H) $(EMIT_RTL_H)
OPTABS_H = optabs.h insn-codes.h insn-opinit.h
REGS_H = regs.h $(MACHMODE_H) hard-reg-set.h
-SCHED_INT_H = sched-int.h $(INSN_ATTR_H) $(BASIC_BLOCK_H) $(RTL_H) $(DF_H) \
- $(REGSET_H)
-SEL_SCHED_IR_H = sel-sched-ir.h $(INSN_ATTR_H) $(BASIC_BLOCK_H) $(RTL_H) \
- $(GGC_H) $(BITMAP_H) $(SCHED_INT_H) $(CFGLOOP_H) $(REGSET_H)
-SEL_SCHED_DUMP_H = sel-sched-dump.h $(SEL_SCHED_IR_H)
CFGLOOP_H = cfgloop.h $(BASIC_BLOCK_H) double-int.h \
$(BITMAP_H) sbitmap.h
IPA_UTILS_H = ipa-utils.h $(TREE_H) $(CGRAPH_H)
@@ -915,13 +901,9 @@ CGRAPH_H = cgraph.h $(VEC_H) $(TREE_H) $(BASIC_BLOCK_H) $(FUNCTION_H) \
cif-code.def ipa-ref.h ipa-ref-inline.h $(LINKER_PLUGIN_API_H) is-a.h
DF_H = df.h $(BITMAP_H) $(REGSET_H) sbitmap.h $(BASIC_BLOCK_H) \
alloc-pool.h $(TIMEVAR_H)
-VALTRACK_H = valtrack.h $(BITMAP_H) $(DF_H) $(RTL_H) $(BASIC_BLOCK_H) \
- $(HASH_TABLE_H)
RESOURCE_H = resource.h hard-reg-set.h $(DF_H)
-DDG_H = ddg.h sbitmap.h $(DF_H)
GCC_H = gcc.h version.h $(DIAGNOSTIC_CORE_H)
GGC_H = ggc.h gtype-desc.h statistics.h
-GGC_INTERNAL_H = ggc-internal.h $(GGC_H)
TIMEVAR_H = timevar.h timevar.def
INSN_ATTR_H = insn-attr.h insn-attr-common.h $(INSN_ADDR_H)
INSN_ADDR_H = $(srcdir)/insn-addr.h
@@ -936,11 +918,6 @@ CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \
$(srcdir)/../libcpp/include/cpplib.h
INPUT_H = $(srcdir)/../libcpp/include/line-map.h input.h
OPTS_H = $(INPUT_H) $(VEC_H) opts.h $(OBSTACK_H)
-DECNUM_H = $(DECNUM)/decContext.h $(DECNUM)/decDPD.h $(DECNUM)/decNumber.h \
- $(DECNUMFMT)/decimal32.h $(DECNUMFMT)/decimal64.h \
- $(DECNUMFMT)/decimal128.h $(DECNUMFMT)/decimal128Local.h
-BACKTRACE_H = $(BACKTRACE)/backtrace.h
-MKDEPS_H = $(srcdir)/../libcpp/include/mkdeps.h
SYMTAB_H = $(srcdir)/../libcpp/include/symtab.h $(OBSTACK_H)
CPP_ID_DATA_H = $(CPPLIB_H) $(srcdir)/../libcpp/include/cpp-id-data.h
CPP_INTERNAL_H = $(srcdir)/../libcpp/internal.h $(CPP_ID_DATA_H)
@@ -950,48 +927,24 @@ TREE_FLOW_H = tree-flow.h tree-flow-inline.h tree-ssa-operands.h \
$(BITMAP_H) sbitmap.h $(BASIC_BLOCK_H) $(GIMPLE_H) \
$(HASHTAB_H) $(CGRAPH_H) $(IPA_REFERENCE_H) \
tree-ssa-alias.h
-TREE_HASHER_H = tree-hasher.h $(HASH_TABLE_H) $(TREE_FLOW_H)
-TREE_SSA_LIVE_H = tree-ssa-live.h $(PARTITION_H)
-SSAEXPAND_H = ssaexpand.h $(TREE_SSA_LIVE_H)
PRETTY_PRINT_H = pretty-print.h $(INPUT_H) $(OBSTACK_H)
TREE_PRETTY_PRINT_H = tree-pretty-print.h $(PRETTY_PRINT_H)
GIMPLE_PRETTY_PRINT_H = gimple-pretty-print.h $(TREE_PRETTY_PRINT_H)
DIAGNOSTIC_CORE_H = diagnostic-core.h $(INPUT_H) bversion.h diagnostic.def
DIAGNOSTIC_H = diagnostic.h $(DIAGNOSTIC_CORE_H) $(PRETTY_PRINT_H)
-DWARF2OUT_H = dwarf2out.h $(DWARF2_H)
C_PRETTY_PRINT_H = c-family/c-pretty-print.h $(PRETTY_PRINT_H) \
$(C_COMMON_H) $(TREE_H)
-SCEV_H = tree-scalar-evolution.h $(GGC_H) tree-chrec.h $(PARAMS_H)
-OMEGA_H = omega.h $(PARAMS_H)
-TREE_DATA_REF_H = tree-data-ref.h $(OMEGA_H) graphds.h $(SCEV_H)
TREE_INLINE_H = tree-inline.h
REAL_H = real.h $(MACHMODE_H)
-IRA_INT_H = ira.h ira-int.h $(CFGLOOP_H) alloc-pool.h
-LRA_INT_H = lra.h $(BITMAP_H) $(RECOG_H) $(INSN_ATTR_H) insn-codes.h \
- insn-config.h $(REGS_H) lra-int.h
-DBGCNT_H = dbgcnt.h dbgcnt.def
LTO_STREAMER_H = lto-streamer.h $(LINKER_PLUGIN_API_H) $(TARGET_H) \
$(CGRAPH_H) $(VEC_H) $(HASH_TABLE_H) $(TREE_H) $(GIMPLE_H) \
$(GCOV_IO_H) $(DIAGNOSTIC_H) alloc-pool.h pointer-set.h
-DATA_STREAMER_H = data-streamer.h $(VEC_H) $(LTO_STREAMER_H)
-GIMPLE_STREAMER_H = gimple-streamer.h $(LTO_STREAMER_H) $(BASIC_BLOCK_H) \
- $(FUNCTION_H)
-TREE_STREAMER_H = tree-streamer.h $(TREE_H) $(LTO_STREAMER_H) \
- $(STREAMER_HOOKS_H)
-STREAMER_HOOKS_H = streamer-hooks.h $(TREE_H)
-TREE_VECTORIZER_H = tree-vectorizer.h $(TREE_DATA_REF_H) $(TARGET_H) \
- $(HASH_TABLE_H)
IPA_PROP_H = ipa-prop.h $(TREE_H) $(VEC_H) $(CGRAPH_H) $(GIMPLE_H) alloc-pool.h
-IPA_INLINE_H = ipa-inline.h $(IPA_PROP_H)
-GSTAB_H = gstab.h stab.def
BITMAP_H = bitmap.h $(HASHTAB_H) statistics.h
GCC_PLUGIN_H = gcc-plugin.h highlev-plugin-common.h plugin.def \
$(CONFIG_H) $(SYSTEM_H) $(HASHTAB_H)
PLUGIN_H = plugin.h $(GCC_PLUGIN_H)
PLUGIN_VERSION_H = plugin-version.h configargs.h
-LIBFUNCS_H = libfuncs.h $(HASHTAB_H)
-GRAPHITE_HTAB_H = graphite-htab.h graphite-clast-to-gimple.h $(HASH_TABLE_H)
-CONTEXT_H = context.h
#\f
# Now figure out from those variables how to compile and link.
--
1.8.1.4
next prev parent reply other threads:[~2013-07-29 16:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-29 16:24 [PATCH v2 00/18] resurrect automatic dependencies Tom Tromey
2013-07-29 16:24 ` [PATCH v2 10/18] Fix up c-family targets Tom Tromey
2013-07-29 16:24 ` [PATCH v2 12/18] convert the Go front end to automatic dependencies Tom Tromey
2013-07-29 16:24 ` [PATCH v2 08/18] convert the ObjC++ " Tom Tromey
2013-07-29 16:40 ` Mike Stump
2013-07-29 16:53 ` Tom Tromey
2013-07-29 16:24 ` [PATCH v2 13/18] convert LTO " Tom Tromey
2013-07-29 16:24 ` [PATCH v2 17/18] remove last definition of CROSS_FLOAT_H Tom Tromey
2013-07-29 16:24 ` [PATCH v2 11/18] convert the Fortran front end to automatic dependencies Tom Tromey
2013-07-29 16:25 ` [PATCH v2 14/18] remove explicit dependencies Tom Tromey
2013-07-29 16:25 ` [PATCH v2 16/18] remove last reference to TREE_GIMPLE_H Tom Tromey
2013-07-29 16:25 ` [PATCH v2 05/18] convert the C front end to automatic dependencies Tom Tromey
2013-07-29 16:25 ` Tom Tromey [this message]
2013-07-29 16:25 ` [PATCH v2 15/18] make out_object_file rule use " Tom Tromey
2013-07-29 16:25 ` [PATCH v2 02/18] update generated_files Tom Tromey
2013-07-29 16:25 ` [PATCH v2 06/18] convert the C++ front end to automatic dependencies Tom Tromey
2013-07-30 16:39 ` Gabriel Dos Reis
2013-07-29 16:25 ` [PATCH v2 04/18] add configury Tom Tromey
2013-07-29 16:25 ` [PATCH v2 01/18] clean up SHLIB so subshells are not needed Tom Tromey
2013-07-29 16:25 ` [PATCH v2 07/18] convert the ObjC front end to automatic dependencies Tom Tromey
2013-07-29 16:42 ` Mike Stump
2013-07-29 16:25 ` [PATCH v2 03/18] move generated_files order-only dependency later Tom Tromey
2013-07-29 16:29 ` [PATCH v2 09/18] convert the Java front end to automatic dependencies Tom Tromey
2013-07-29 17:05 ` [PATCH v2 00/18] resurrect " Mike Stump
2013-08-12 8:46 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375115069-31143-19-git-send-email-tromey@redhat.com \
--to=tromey@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).