summaryrefslogtreecommitdiff
path: root/gcc/dumpfile.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2019-10-24 16:03:26 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2019-10-24 16:03:26 +0000
commit84d2160d5d1d2fb7bcba2402d20cbfb570b34dbd (patch)
treebc82ffa7a808e107b215fd5ff225212bab45b9bf /gcc/dumpfile.c
parent75c6a925dab5b7af9ab47c10906cb0e140261cc2 (diff)
[dump] small source cleanup
https://gcc.gnu.org/ml/gcc-patches/2019-10/msg01760.html * dumpfile.c (dump_begin): Reorder decls to use RAII. From-SVN: r277415
Diffstat (limited to 'gcc/dumpfile.c')
-rw-r--r--gcc/dumpfile.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c
index 5263d3a2134..7ea8f85c9bd 100644
--- a/gcc/dumpfile.c
+++ b/gcc/dumpfile.c
@@ -1532,21 +1532,17 @@ FILE *
gcc::dump_manager::
dump_begin (int phase, dump_flags_t *flag_ptr, int part)
{
- char *name;
- struct dump_file_info *dfi;
- FILE *stream;
-
if (phase == TDI_none || !dump_phase_enabled_p (phase))
return NULL;
- name = get_dump_file_name (phase, part);
+ char *name = get_dump_file_name (phase, part);
if (!name)
return NULL;
- dfi = get_dump_file_info (phase);
+ struct dump_file_info *dfi = get_dump_file_info (phase);
/* 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);
+ FILE *stream = dump_open (name, part != -1 || dfi->pstate < 0);
if (stream)
dfi->pstate = 1;
free (name);