diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2003-08-05 21:15:57 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2003-08-05 21:15:57 +0000 |
commit | b20d9f0c07107060fe1873ee33e40b83ba425d12 (patch) | |
tree | b7f8db5c8aee0a49ffa5b4f9b148561a8a68a233 /gcc/doc | |
parent | 1260d70fb61e50255cf7f185efff31f568a7049c (diff) | |
download | gcc-b20d9f0c07107060fe1873ee33e40b83ba425d12.zip gcc-b20d9f0c07107060fe1873ee33e40b83ba425d12.tar.gz gcc-b20d9f0c07107060fe1873ee33e40b83ba425d12.tar.bz2 |
c.opt: Introduce -fworking-directory.
* c.opt: Introduce -fworking-directory.
* doc/cpp.texi, doc/invoke.texi, doc/cppopts.texi: Document it.
* c-common.h (flag_working_directory): Declare.
* c-common.c (flag_working_directory): Define.
* c-opts.c (c_common_handle_options): Set it.
(sanitize_cpp_opts): Set...
* cpplib.h (struct cpp_options): ... working_directory option.
(struct cpp_callbacks): Add dir_change.
* cppinit.c (read_original_filename): Call...
(read_original_directory): New. Look for # 1 "directory//"
and process it.
(cpp_read_main_file): Call dir_change callback if working_directory
option is set.
* gcc.c (cpp_unique_options): Pass -g*.
* c-lex.c (cb_dir_change): New.
(init_c_lex): Set dir_change callback.
* toplev.c (src_pwd): New static variable.
(set_src_pwd, get_src_pwd): New functions.
* toplev.h (get_src_pwd, set_src_pwd): Declare.
* dbxout.c (dbxout_init): Call get_src_pwd() instead of getpwd().
* dwarf2out.c (gen_compile_unit_die): Likewise.
* dwarfout.c (output_compile_unit_die, dwarfout_init): Likewise.
From-SVN: r70189
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/cpp.texi | 4 | ||||
-rw-r--r-- | gcc/doc/cppopts.texi | 18 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 3 |
3 files changed, 22 insertions, 3 deletions
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index a6ff40c..2db1ee1 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -4133,7 +4133,9 @@ without notice. cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] [@option{-I}@var{dir}@dots{}] [@option{-W}@var{warn}@dots{}] [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] - [@option{-MP}] [@option{-MQ} @var{target}@dots{}] [@option{-MT} @var{target}@dots{}] + [@option{-MP}] [@option{-MQ} @var{target}@dots{}] + [@option{-MT} @var{target}@dots{}] + [@option{-P}] [@option{-fno-working-directory}] [@option{-x} @var{language}] [@option{-std=}@var{standard}] @var{infile} @var{outfile} diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi index 8096763..4988227 100644 --- a/gcc/doc/cppopts.texi +++ b/gcc/doc/cppopts.texi @@ -1,4 +1,4 @@ -@c Copyright (c) 1999, 2000, 2001, 2002 +@c Copyright (c) 1999, 2000, 2001, 2002, 2003 @c Free Software Foundation, Inc. @c This is part of the CPP and GCC manuals. @c For copying conditions, see the file gcc.texi. @@ -513,6 +513,22 @@ corresponds to the width of @code{wchar_t}. As with by the system's @code{iconv} library routine; however, you will have problems with encodings that do not fit exactly in @code{wchar_t}. +@item -fworking-directory +@opindex fworking-directory +@opindex fno-working-directory +Enable generation of linemarkers in the preprocessor output that will +let the compiler know the current working directory at the time of +preprocessing. When this option is enabled, the preprocessor will +emit, after the initial linemarker, a second linemarker with the +current working directory followed by two slashes. GCC will use this +directory, when it's present in the preprocessed input, as the +directory emitted as the current working directory in some debugging +information formats. This option is implicitly enabled if debugging +information is enabled, but this can be inhibited with the negated +form @option{-fno-working-directory}. If the @option{-P} flag is +present in the command line, this option has no effect, since no +@code{#line} directives are emitted whatsoever. + @item -fno-show-column @opindex fno-show-column Do not print column numbers in diagnostics. This may be necessary if diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 518b527..40cba57 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -301,7 +301,8 @@ in the following sections. -include @var{file} -imacros @var{file} @gol -iprefix @var{file} -iwithprefix @var{dir} @gol -iwithprefixbefore @var{dir} -isystem @var{dir} @gol --M -MM -MF -MG -MP -MQ -MT -nostdinc -P -remap @gol +-M -MM -MF -MG -MP -MQ -MT -nostdinc @gol +-P -fworking-directory -remap @gol -trigraphs -undef -U@var{macro} -Wp,@var{option} @gol -Xpreprocessor @var{option}} |