X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gcc%2Fc-pch.c;h=8433f8633dd779036607298d29f970ff06e8ab8f;hb=7a50adb78fc252c3fcd01ca0f199b8ec914c3f67;hp=8273914f1443df3d814027761519c0a2fe82ef2f;hpb=48c5422943175e257c75cd80ccc78ba63f76a3ea;p=gcc.git diff --git a/gcc/c-pch.c b/gcc/c-pch.c index 8273914f144..8433f8633dd 100644 --- a/gcc/c-pch.c +++ b/gcc/c-pch.c @@ -1,5 +1,6 @@ /* Precompiled header implementation for the C languages. - Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. This file is part of GCC. @@ -45,7 +46,6 @@ static const struct c_pch_matching const char *flag_name; } pch_matching[] = { { &flag_exceptions, "-fexceptions" }, - { &flag_unit_at_a_time, "-funit-at-a-time" } }; enum { @@ -93,7 +93,7 @@ static const char * get_ident (void) { static char result[IDENT_LENGTH]; - static const char templ[IDENT_LENGTH] = "gpch.013"; + static const char templ[] = "gpch.013"; static const char c_language_chars[] = "Co+O"; memcpy (result, templ, IDENT_LENGTH); @@ -113,7 +113,7 @@ pch_init (void) FILE *f; struct c_pch_validity v; void *target_validity; - static const char partial_pch[IDENT_LENGTH] = "gpcWrite"; + static const char partial_pch[] = "gpcWrite"; #ifdef ASM_COMMENT_START if (flag_verbose_asm) @@ -134,6 +134,7 @@ pch_init (void) gcc_assert (memcmp (executable_checksum, no_checksum, 16) != 0); + memset (&v, '\0', sizeof (v)); v.debug_info_type = write_symbols; { size_t i; @@ -368,6 +369,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name, struct c_pch_header h; struct save_macro_data *smd; expanded_location saved_loc; + bool saved_trace_includes; f = fdopen (fd, "rb"); if (f == NULL) @@ -413,6 +415,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name, /* Save the location and then restore it after reading the PCH. */ saved_loc = expand_location (line_table->highest_line); + saved_trace_includes = line_table->trace_includes; cpp_prepare_state (pfile, &smd); @@ -426,6 +429,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name, fclose (f); + line_table->trace_includes = saved_trace_includes; cpp_set_line_map (pfile, line_table); linemap_add (line_table, LC_RENAME, 0, saved_loc.file, saved_loc.line); @@ -461,7 +465,7 @@ c_common_pch_pragma (cpp_reader *pfile, const char *name) if (!cpp_get_options (pfile)->preprocessed) { error ("pch_preprocess pragma should only be used with -fpreprocessed"); - inform ("use #include instead"); + inform (input_location, "use #include instead"); return; } @@ -472,7 +476,7 @@ c_common_pch_pragma (cpp_reader *pfile, const char *name) if (c_common_valid_pch (pfile, name, fd) != 1) { if (!cpp_get_options (pfile)->warn_invalid_pch) - inform ("use -Winvalid-pch for more information"); + inform (input_location, "use -Winvalid-pch for more information"); fatal_error ("%s: PCH file was invalid", name); }