diff mbox

[13/13] Switch -ftrack-macro-expansion=2 on by default.

Message ID m38vhjq3t4.fsf@redhat.com
State New
Headers show

Commit Message

Dodji Seketeli April 25, 2012, 2:33 p.m. UTC
Hopefully closing the series, this patch switches the compiler to
-ftrack-macro-expansion=2 by default.

Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.

libcpp/

	* init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
	by default.  Add comments.

gcc/docs/

	* cppopts.texi: Adjust for enabling -ftrack-macro-expansion=2 by
	default.
---
 gcc/doc/cppopts.texi |    2 ++
 libcpp/init.c        |    6 ++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

Comments

Gabriel Dos Reis April 25, 2012, 3:26 p.m. UTC | #1
On Wed, Apr 25, 2012 at 9:33 AM, Dodji Seketeli <dodji@redhat.com> wrote:
> Hopefully closing the series, this patch switches the compiler to
> -ftrack-macro-expansion=2 by default.
>
> Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.

Makes sense to me; Tom?

-- Gaby
Tom Tromey April 25, 2012, 5:50 p.m. UTC | #2
>>>>> "Gaby" == Gabriel Dos Reis <gdr@integrable-solutions.net> writes:

Gaby> On Wed, Apr 25, 2012 at 9:33 AM, Dodji Seketeli <dodji@redhat.com> wrote:
>> Hopefully closing the series, this patch switches the compiler to
>> -ftrack-macro-expansion=2 by default.
>> 
>> Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.

Gaby> Makes sense to me; Tom?

Yes, do it.  Thanks.

Tom
diff mbox

Patch

diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi
index 205d870..27b1095 100644
--- a/gcc/doc/cppopts.texi
+++ b/gcc/doc/cppopts.texi
@@ -617,6 +617,8 @@  tokens locations completely. This value is the most memory hungry.
 When this option is given no argument, the default parameter value is
 @samp{2}.
 
+Note that -ftrack-macro-expansion=2 is activated by default.
+
 @item -fexec-charset=@var{charset}
 @opindex fexec-charset
 @cindex character set, execution
diff --git a/libcpp/init.c b/libcpp/init.c
index 5fa82ca..ba1e9cd 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -174,6 +174,12 @@  cpp_create_reader (enum c_lang lang, hash_table *table,
   CPP_OPTION (pfile, warn_dollars) = 1;
   CPP_OPTION (pfile, warn_variadic_macros) = 1;
   CPP_OPTION (pfile, warn_builtin_macro_redefined) = 1;
+  /* By default, track locations of tokens resulting from macro
+     expansion.  The '2' means, track the locations with the highest
+     accuracy.  Read the comments for struct
+     cpp_options::track_macro_expansion to learn about the other
+     values.  */
+  CPP_OPTION (pfile, track_macro_expansion) = 2;
   CPP_OPTION (pfile, warn_normalize) = normalized_C;
 
   /* Default CPP arithmetic to something sensible for the host for the