Commit ee4c708e by Ben Elliston Committed by Ben Elliston

gcc.c (option_map): Add --coverage.

	* gcc.c (option_map): Add --coverage.
	(LINK_COMMAND_SPEC): Pass -lgcov for `coverage'.
	(cc1_options): Pass -fprofile-arcs -ftest-coverage for `coverage'.
	* config/darwin.h: Pass -lgcov for `coverage'.
	* doc/invoke.texi (Debugging Options): Document --coverage.

From-SVN: r95878
parent c7d1b449
2005-03-04 Ben Elliston <bje@au.ibm.com>
* gcc.c (option_map): Add --coverage.
(LINK_COMMAND_SPEC): Pass -lgcov for `coverage'.
(cc1_options): Pass -fprofile-arcs -ftest-coverage for `coverage'.
* config/darwin.h: Pass -lgcov for `coverage'.
* doc/invoke.texi (Debugging Options): Document --coverage.
2005-03-04 Kazu Hirata <kazu@cs.umass.edu> 2005-03-04 Kazu Hirata <kazu@cs.umass.edu>
* gcse.c (bypass_block): Use find_edge wherever possible. * gcse.c (bypass_block): Use find_edge wherever possible.
......
...@@ -226,7 +226,7 @@ extern const char *darwin_fix_and_continue_switch; ...@@ -226,7 +226,7 @@ extern const char *darwin_fix_and_continue_switch;
%{!Zdynamiclib:%{A} %{e*} %{m} %{N} %{n} %{r} %{u*} %{x} %{z}} \ %{!Zdynamiclib:%{A} %{e*} %{m} %{N} %{n} %{r} %{u*} %{x} %{z}} \
%{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \ %{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \
%{!Zdynamiclib:%{!A:%{!nostdlib:%{!nostartfiles:%S}}}} \ %{!Zdynamiclib:%{!A:%{!nostdlib:%{!nostartfiles:%S}}}} \
%{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov} \ %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate|coverage:-lgcov} \
%{!nostdlib:%{!nodefaultlibs:%G %L}} \ %{!nostdlib:%{!nodefaultlibs:%G %L}} \
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}}" %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}}"
......
...@@ -3345,6 +3345,15 @@ the basename of the source file. In both cases any suffix is removed ...@@ -3345,6 +3345,15 @@ the basename of the source file. In both cases any suffix is removed
(e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
@file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}). @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
@cindex @command{gcov}
@item --coverage
@opindex coverage
This option is used to compile and link code instrumented for coverage
analysis. The option is a synonym for @option{-fprofile-arcs}
@option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
linking). See the documentation for those options for more details.
@itemize @itemize
@item @item
......
...@@ -700,7 +700,7 @@ proper position among the other output files. */ ...@@ -700,7 +700,7 @@ proper position among the other output files. */
%(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\ %(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
%{static:} %{L*} %(mfwrap) %(link_libgcc) %o %(mflib)\ %{static:} %{L*} %(mfwrap) %(link_libgcc) %o %(mflib)\
%{fprofile-arcs|fprofile-generate:-lgcov}\ %{fprofile-arcs|fprofile-generate|coverage:-lgcov}\
%{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}\ %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}\
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}" %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
#endif #endif
...@@ -796,7 +796,8 @@ static const char *cc1_options = ...@@ -796,7 +796,8 @@ static const char *cc1_options =
%{--target-help:--target-help}\ %{--target-help:--target-help}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\ %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
%{fsyntax-only:-o %j} %{-param*}\ %{fsyntax-only:-o %j} %{-param*}\
%{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants}"; %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants}\
%{coverage:-fprofile-arcs -ftest-coverage}";
static const char *asm_options = static const char *asm_options =
"%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}"; "%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
...@@ -1065,6 +1066,7 @@ static const struct option_map option_map[] = ...@@ -1065,6 +1066,7 @@ static const struct option_map option_map[] =
{"--for-assembler", "-Wa", "a"}, {"--for-assembler", "-Wa", "a"},
{"--for-linker", "-Xlinker", "a"}, {"--for-linker", "-Xlinker", "a"},
{"--force-link", "-u", "a"}, {"--force-link", "-u", "a"},
{"--coverage", "-coverage", 0},
{"--imacros", "-imacros", "a"}, {"--imacros", "-imacros", "a"},
{"--include", "-include", "a"}, {"--include", "-include", "a"},
{"--include-barrier", "-I-", 0}, {"--include-barrier", "-I-", 0},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment