extern bool c_common_init (void);
extern void c_common_finish (void);
extern void c_common_parse_file (void);
-extern FILE *get_dump_info (int, dump_flags_t *);
extern alias_set_type c_common_get_alias_set (tree);
extern void c_register_builtin_type (tree, const char*);
extern bool c_promoting_integer_type_p (const_tree);
#include "dumpfile.h"
#include "c-ubsan.h"
#include "tree-nested.h"
+#include "context.h"
/* The gimplification pass converts the language-dependent trees
(ld-trees) emitted by the parser into language-independent trees
void
c_genericize (tree fndecl)
{
+ dump_file_info *dfi;
FILE *dump_orig;
dump_flags_t local_dump_flags;
struct cgraph_node *cgn;
do_warn_duplicated_branches_r, NULL);
/* Dump the C-specific tree IR. */
- dump_orig = get_dump_info (TDI_original, &local_dump_flags);
+ dfi = g->get_dumps ()->get_dump_file_info (TDI_original);
+ dump_orig = dfi->pstream;
+ local_dump_flags = dfi->pflags;
if (dump_orig)
{
fprintf (dump_orig, "\n;; Function %s",
#include "mkdeps.h"
#include "dumpfile.h"
#include "file-prefix-map.h" /* add_*_prefix_map() */
+#include "context.h"
#ifndef DOLLARS_IN_IDENTIFIERS
# define DOLLARS_IN_IDENTIFIERS true
/* Number of deferred options scanned for -include. */
static size_t include_cursor;
-/* Dump files/flags to use during parsing. */
-static FILE *original_dump_file = NULL;
-static dump_flags_t original_dump_flags;
-
/* Whether any standard preincluded header has been preincluded. */
static bool done_preinclude;
void
c_common_parse_file (void)
{
- unsigned int i;
-
- i = 0;
- for (;;)
+ auto dumps = g->get_dumps ();
+ for (unsigned int i = 0;;)
{
c_finish_options ();
/* Open the dump file to use for the original dump output
here, to be used during parsing for the current file. */
- original_dump_file = dump_begin (TDI_original, &original_dump_flags);
+ dumps->dump_start (TDI_original, &dump_flags);
pch_init ();
push_file_scope ();
c_parse_file ();
cpp_clear_file_cache (parse_in);
this_input_filename
= cpp_read_main_file (parse_in, in_fnames[i]);
- if (original_dump_file)
- {
- dump_end (TDI_original, original_dump_file);
- original_dump_file = NULL;
- }
/* If an input file is missing, abandon further compilation.
cpplib has issued a diagnostic. */
if (!this_input_filename)
break;
+ dumps->dump_finish (TDI_original);
}
c_parse_final_cleanups ();
-}
-
-/* Returns the appropriate dump file for PHASE to dump with FLAGS. */
-
-FILE *
-get_dump_info (int phase, dump_flags_t *flags)
-{
- gcc_assert (phase == TDI_original);
-
- *flags = original_dump_flags;
- return original_dump_file;
+ dumps->dump_finish (TDI_original);
}
/* Common finish hook for the C, ObjC and C++ front ends. */
node->order = first_clone->order;
symtab->symtab_prevail_in_asm_name_hash (node);
node->decl->decl_with_vis.symtab_node = node;
- if (dump_file)
+ if (dump_file && symtab->state != PARSING)
fprintf (dump_file, "Introduced new external node "
"(%s) and turned into root of the clone tree.\n",
node->dump_name ());
}
- else if (dump_file)
+ else if (dump_file && symtab->state != PARSING)
fprintf (dump_file, "Introduced new external node "
"(%s).\n", node->dump_name ());
return node;