#include "c-pragma.h"
#include "ggc.h"
#include "langhooks.h"
+#include "hosthooks.h"
struct c_pch_validity
{
{
static char result[IDENT_LENGTH];
static const char template[IDENT_LENGTH] = "gpch.011";
+ static const char c_language_chars[] = "Co+O";
memcpy (result, template, IDENT_LENGTH);
- if (c_language == clk_c)
- result[4] = flag_objc ? 'o' : 'C';
- else if (c_language == clk_cplusplus)
- result[4] = flag_objc ? 'O' : '+';
- else
- abort ();
+ result[4] = c_language_chars[c_language];
+
return result;
}
written += size;
}
free (buf);
+ /* asm_out_file can be written afterwards, so must be flushed first. */
+ fflush (asm_out_file);
gt_pch_save (pch_outfile);
cpp_write_pch_state (parse_in, pch_outfile);
const char *pch_ident;
struct c_pch_validity v;
- if (! allow_pch)
- return 2;
-
/* Perform a quick test of whether this is a valid
precompiled header for the current language. */
return;
}
- allow_pch = 0;
+ cpp_get_callbacks (parse_in)->valid_pch = NULL;
if (fread (&h, sizeof (h), 1, f) != 1)
{
fclose (f);
}
+
+/* Indicate that no more PCH files should be read. */
+
+void
+c_common_no_more_pch (void)
+{
+ if (cpp_get_callbacks (parse_in)->valid_pch)
+ {
+ cpp_get_callbacks (parse_in)->valid_pch = NULL;
+ host_hooks.gt_pch_use_address (NULL, 0);
+ }
+}