Commit 75fdb07e by Jan Hubicka Committed by Jan Hubicka

dumpfile.c (gcc::dump_manager::get_dump_file_name): Add PART parameter.


	* dumpfile.c (gcc::dump_manager::get_dump_file_name): Add PART
	 parameter.
	(gcc::dump_manager::get_dump_file_name): likewise.
	(dump_begin): Likewise.
	* dumpfile.h (dump_begin): Update prototype.
	(gcc::dump_manager::get_dump_file_name,
	gcc::dump_manager::get_dump_file_name): Update prototype.

From-SVN: r262591
parent 5249ee4d
2018-07-12 Jan Hubicka <hubicka@ucw.cz>
* dumpfile.c (gcc::dump_manager::get_dump_file_name): Add PART
parameter.
(gcc::dump_manager::get_dump_file_name): likewise.
(dump_begin): Likewise.
* dumpfile.h (dump_begin): Update prototype.
(gcc::dump_manager::get_dump_file_name,
gcc::dump_manager::get_dump_file_name): Update prototype.
2018-07-12 Richard Sandiford <richard.sandiford@linaro.org> 2018-07-12 Richard Sandiford <richard.sandiford@linaro.org>
* internal-fn.h (vectorizable_internal_fn_p): New function. * internal-fn.h (vectorizable_internal_fn_p): New function.
......
...@@ -307,7 +307,7 @@ get_dump_file_info_by_switch (const char *swtch) const ...@@ -307,7 +307,7 @@ get_dump_file_info_by_switch (const char *swtch) const
char * char *
gcc::dump_manager:: gcc::dump_manager::
get_dump_file_name (int phase) const get_dump_file_name (int phase, int part) const
{ {
struct dump_file_info *dfi; struct dump_file_info *dfi;
...@@ -316,7 +316,7 @@ get_dump_file_name (int phase) const ...@@ -316,7 +316,7 @@ get_dump_file_name (int phase) const
dfi = get_dump_file_info (phase); dfi = get_dump_file_info (phase);
return get_dump_file_name (dfi); return get_dump_file_name (dfi, part);
} }
/* Return the name of the dump file for the given dump_file_info. /* Return the name of the dump file for the given dump_file_info.
...@@ -326,7 +326,7 @@ get_dump_file_name (int phase) const ...@@ -326,7 +326,7 @@ get_dump_file_name (int phase) const
char * char *
gcc::dump_manager:: gcc::dump_manager::
get_dump_file_name (struct dump_file_info *dfi) const get_dump_file_name (struct dump_file_info *dfi, int part) const
{ {
char dump_id[10]; char dump_id[10];
...@@ -350,7 +350,14 @@ get_dump_file_name (struct dump_file_info *dfi) const ...@@ -350,7 +350,14 @@ get_dump_file_name (struct dump_file_info *dfi) const
dump_id[0] = '\0'; dump_id[0] = '\0';
} }
return concat (dump_base_name, dump_id, dfi->suffix, NULL); if (part != -1)
{
char part_id[8];
snprintf (part_id, sizeof (part_id), ".%i", part);
return concat (dump_base_name, dump_id, part_id, dfi->suffix, NULL);
}
else
return concat (dump_base_name, dump_id, dfi->suffix, NULL);
} }
/* Open a dump file called FILENAME. Some filenames are special and /* Open a dump file called FILENAME. Some filenames are special and
...@@ -768,17 +775,19 @@ dump_finish (int phase) ...@@ -768,17 +775,19 @@ dump_finish (int phase)
/* Begin a tree dump for PHASE. Stores any user supplied flag in /* Begin a tree dump for PHASE. Stores any user supplied flag in
*FLAG_PTR and returns a stream to write to. If the dump is not *FLAG_PTR and returns a stream to write to. If the dump is not
enabled, returns NULL. enabled, returns NULL.
Multiple calls will reopen and append to the dump file. */ PART can be used for dump files which should be split to multiple
parts. PART == -1 indicates dump file with no parts.
If PART is -1, multiple calls will reopen and append to the dump file. */
FILE * FILE *
dump_begin (int phase, dump_flags_t *flag_ptr) dump_begin (int phase, dump_flags_t *flag_ptr, int part)
{ {
return g->get_dumps ()->dump_begin (phase, flag_ptr); return g->get_dumps ()->dump_begin (phase, flag_ptr, part);
} }
FILE * FILE *
gcc::dump_manager:: gcc::dump_manager::
dump_begin (int phase, dump_flags_t *flag_ptr) dump_begin (int phase, dump_flags_t *flag_ptr, int part)
{ {
char *name; char *name;
struct dump_file_info *dfi; struct dump_file_info *dfi;
...@@ -787,12 +796,14 @@ dump_begin (int phase, dump_flags_t *flag_ptr) ...@@ -787,12 +796,14 @@ dump_begin (int phase, dump_flags_t *flag_ptr)
if (phase == TDI_none || !dump_phase_enabled_p (phase)) if (phase == TDI_none || !dump_phase_enabled_p (phase))
return NULL; return NULL;
name = get_dump_file_name (phase); name = get_dump_file_name (phase, part);
if (!name) if (!name)
return NULL; return NULL;
dfi = get_dump_file_info (phase); dfi = get_dump_file_info (phase);
stream = dump_open (name, dfi->pstate < 0); /* We do not support re-opening of dump files with parts. This would require
tracking pstate per part of the dump file. */
stream = dump_open (name, part != -1 || dfi->pstate < 0);
if (stream) if (stream)
dfi->pstate = 1; dfi->pstate = 1;
free (name); free (name);
......
...@@ -416,7 +416,7 @@ class dump_location_t ...@@ -416,7 +416,7 @@ class dump_location_t
}; };
/* In dumpfile.c */ /* In dumpfile.c */
extern FILE *dump_begin (int, dump_flags_t *); extern FILE *dump_begin (int, dump_flags_t *, int part=-1);
extern void dump_end (int, FILE *); extern void dump_end (int, FILE *);
extern int opt_info_switch_p (const char *); extern int opt_info_switch_p (const char *);
extern const char *dump_flag_name (int); extern const char *dump_flag_name (int);
...@@ -538,10 +538,10 @@ public: ...@@ -538,10 +538,10 @@ public:
/* Return the name of the dump file for the given phase. /* Return the name of the dump file for the given phase.
If the dump is not enabled, returns NULL. */ If the dump is not enabled, returns NULL. */
char * char *
get_dump_file_name (int phase) const; get_dump_file_name (int phase, int part = -1) const;
char * char *
get_dump_file_name (struct dump_file_info *dfi) const; get_dump_file_name (struct dump_file_info *dfi, int part = -1) const;
int int
dump_switch_p (const char *arg); dump_switch_p (const char *arg);
...@@ -560,7 +560,7 @@ public: ...@@ -560,7 +560,7 @@ public:
dump_finish (int phase); dump_finish (int phase);
FILE * FILE *
dump_begin (int phase, dump_flags_t *flag_ptr); dump_begin (int phase, dump_flags_t *flag_ptr, int part);
/* Returns nonzero if tree dump PHASE has been initialized. */ /* Returns nonzero if tree dump PHASE has been initialized. */
int int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment