diff options
author | Tom Tromey <tom@tromey.com> | 2021-05-04 15:26:58 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-05-05 00:06:17 -0600 |
commit | 7c4e5d5eaad59ac4d9cf06934c953537b0b1a367 (patch) | |
tree | 546ee1760961f97d85ef7daa571f9faf70c36d6f /libcc1 | |
parent | 1d9c9726013d006ec91f95423aa16457dfe2a2f9 (diff) | |
download | gcc-7c4e5d5eaad59ac4d9cf06934c953537b0b1a367.zip gcc-7c4e5d5eaad59ac4d9cf06934c953537b0b1a367.tar.gz gcc-7c4e5d5eaad59ac4d9cf06934c953537b0b1a367.tar.bz2 |
libcc1: use foreach
This changes libcc1 to ues foreach in a couple of spots.
libcc1
* libcp1plugin.cc (plugin_context::mark): Use foreach.
* libcc1plugin.cc (plugin_context::mark): Use foreach.
Diffstat (limited to 'libcc1')
-rw-r--r-- | libcc1/libcc1plugin.cc | 13 | ||||
-rw-r--r-- | libcc1/libcp1plugin.cc | 13 |
2 files changed, 10 insertions, 16 deletions
diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc index 65e7482..2a75fab 100644 --- a/libcc1/libcc1plugin.cc +++ b/libcc1/libcc1plugin.cc @@ -235,17 +235,14 @@ plugin_context::plugin_context (int fd) void plugin_context::mark () { - for (hash_table<decl_addr_hasher>::iterator it = address_map.begin (); - it != address_map.end (); - ++it) + for (const auto &item : address_map) { - ggc_mark ((*it)->decl); - ggc_mark ((*it)->address); + ggc_mark (item->decl); + ggc_mark (item->address); } - for (hash_table< nofree_ptr_hash<tree_node> >::iterator - it = preserved.begin (); it != preserved.end (); ++it) - ggc_mark (&*it); + for (const auto &item : preserved) + ggc_mark (&item); } static void diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc index 1fc8e26..3cbad5c 100644 --- a/libcc1/libcp1plugin.cc +++ b/libcc1/libcp1plugin.cc @@ -225,17 +225,14 @@ plugin_context::plugin_context (int fd) void plugin_context::mark () { - for (hash_table<decl_addr_hasher>::iterator it = address_map.begin (); - it != address_map.end (); - ++it) + for (const auto &item : address_map) { - ggc_mark ((*it)->decl); - ggc_mark ((*it)->address); + ggc_mark (item->decl); + ggc_mark (item->address); } - for (hash_table< nofree_ptr_hash<tree_node> >::iterator - it = preserved.begin (); it != preserved.end (); ++it) - ggc_mark (&*it); + for (const auto &item : preserved) + ggc_mark (&item); } static void |