Hello Gabriel,

gch...@google.com (Gabriel Charette) a écrit:

> Here is the updated patch.
>
> It nows exposes two libcpp functions to force the source_location for tokens 
> when desired.
>
> The lexer then checks for a value set by these functions in cpp_reader and 
> acts accordingly when needing a location for a new token (either using the 
> forced_location or calling the linemap as it used to).
>
> It turns out the fortran library made the same mistake of creating a 
> line_table entry for builtins, I fixed it as well in this patch.
>
> Tested on x64 for c++,fortran.
>
> (fyi: I moved the removal of LINEMAP_POSITION_FOR_COLUMN to a separate patch 
> which is checked-in already; thus it doesn't show up in this updated patch 
> obviously.
> )
>
> Ok for trunk?
>
> Gabriel
>
> 2011-08-15  Gabriel Charette  <gch...@google.com>
>
>       gcc/c-family/ChangeLog
>       * c-opts.c (c_finish_options): Force BUILTINS_LOCATION for tokens
>       defined in cpp_init_builtins and c_cpp_builtins.
>
>       gcc/fortran/ChangeLog
>       * cpp.c (gfc_cpp_init): Force BUILTINS_LOCATION for tokens
>       defined in cpp_define_builtins.
>
>       libcpp/ChangeLog
>       * init.c (cpp_create_reader): Inititalize forced_token_location_p.
>       * internal.h (struct cpp_reader): Add field forced_token_location_p.
>       * lex.c (_cpp_lex_direct): Use forced_token_location_p.
>       (cpp_force_token_locations): New.
>       (cpp_stop_forcing_token_locations): New.

I cannot approve or reject this patch, but FWIW, it looks OK to me.

Thanks.

-- 
                Dodji

Reply via email to