aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2018-06-28 14:55:42 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2018-06-28 14:55:42 +0000
commit29b54a9d2d9fbefe57589a69d8e992d3e3b4bd99 (patch)
tree8ba0845992be0c8d1b9334cd9db5504de34f8a67 /gcc/cgraph.c
parentf601629c61e2361bab49eecbcf89703f8fb33e98 (diff)
downloadgcc-29b54a9d2d9fbefe57589a69d8e992d3e3b4bd99.zip
gcc-29b54a9d2d9fbefe57589a69d8e992d3e3b4bd99.tar.gz
gcc-29b54a9d2d9fbefe57589a69d8e992d3e3b4bd99.tar.bz2
Hide alt_dump_file within dumpfile.c
This patch removes alt_dump_file from dumpfile.h, making it static within dumpfile.c. This allows for changing how -fopt-info is implemented, and potentially adding other kinds of dump target, such as remarks or optimization records. Doing so requires changing the implementation of dump_enabled_p, so the patch changes this to a simple lookup of a boolean global, which is updated any time dump_file or alt_dump_file change. gcc/ChangeLog: * cgraph.c (cgraph_node::get_body): Replace assignments to "dump_file" with calls to set_dump_file. * dumpfile.c (alt_dump_file): Make static, and group with... (alt_flags): ...this definition. (dumps_are_enabled): New variable. (refresh_dumps_are_enabled): New function. (set_dump_file): New function. (set_alt_dump_file): New function. (gcc::dump_manager::dump_start): Replace assignments to "dump_file" and "alt_dump_file" with calls to set_dump_file and set_alt_dump_file. (gcc::dump_manager::dump_finish): Likewise. * dumpfile.h (alt_dump_file): Delete decl. (dumps_are_enabled): New variable decl. (set_dump_file): New function decl. (dump_enabled_p): Rewrite in terms of new "dumps_are_enabled" global. * tree-nested.c (lower_nested_functions): Replace assignments to "dump_file" with calls to set_dump_file. From-SVN: r262220
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 3899467..d19f1aa 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -3582,7 +3582,7 @@ cgraph_node::get_body (void)
const char *saved_dump_file_name = dump_file_name;
dump_flags_t saved_dump_flags = dump_flags;
dump_file_name = NULL;
- dump_file = NULL;
+ set_dump_file (NULL);
push_cfun (DECL_STRUCT_FUNCTION (decl));
execute_all_ipa_transforms ();
@@ -3593,7 +3593,7 @@ cgraph_node::get_body (void)
updated = true;
current_pass = saved_current_pass;
- dump_file = saved_dump_file;
+ set_dump_file (saved_dump_file);
dump_file_name = saved_dump_file_name;
dump_flags = saved_dump_flags;
}