From b6ff777cfc7d3cca61aa2743c679d60b3251784d Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Wed, 27 Oct 2004 17:24:20 +0000 Subject: [PATCH] c-lex.c (cb_def_pragma): Clean up code for making location palatable to diagnostic.c. * c-lex.c (cb_def_pragma): Clean up code for making location palatable to diagnostic.c. From-SVN: r89691 --- gcc/ChangeLog | 7 ++++++- gcc/c-lex.c | 18 +++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 92d127ac117c..9102abc9e067 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-10-27 Zack Weinberg + + * c-lex.c (cb_def_pragma): Clean up code for making location + palatable to diagnostic.c. + 2004-10-27 Steven Bosscher PR tree-optimization/17757 @@ -25,7 +30,7 @@ patch originally created by Kelley Cook PR middle-end/14684 - * opts.c (OPT_fprofile_generate): Default to -funroll-loops + * opts.c (OPT_fprofile_generate): Default to -funroll-loops to match -fprofile-use. 2004-10-27 Kazu Hirata diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 415785d22421..f5425ce49e90 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -283,11 +283,16 @@ cb_def_pragma (cpp_reader *pfile, source_location loc) -Wunknown-pragmas has been given. */ if (warn_unknown_pragmas > in_system_header) { -#ifndef USE_MAPPED_LOCATION - const struct line_map *map = linemap_lookup (&line_table, loc); -#endif const unsigned char *space, *name; const cpp_token *s; +#ifndef USE_MAPPED_LOCATION + location_t fe_loc; + const struct line_map *map = linemap_lookup (&line_table, loc); + fe_loc.file = map->to_file; + fe_loc.line = SOURCE_LINE (map, loc); +#else + location_t fe_loc = loc; +#endif space = name = (const unsigned char *) ""; s = cpp_get_token (pfile); @@ -299,12 +304,7 @@ cb_def_pragma (cpp_reader *pfile, source_location loc) name = cpp_token_as_text (pfile, s); } -#ifdef USE_MAPPED_LOCATION - input_location = loc; -#else - input_line = SOURCE_LINE (map, loc); -#endif - warning ("ignoring #pragma %s %s", space, name); + warning ("%Hignoring #pragma %s %s", &fe_loc, space, name); } }