diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2021-11-12 09:06:55 +0100 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2021-11-13 11:45:31 +0100 |
commit | dc777f6b0646fed2f18a580ce249cb6404f89205 (patch) | |
tree | 0a9b090c4e3bfdecb0343487999d7781fd7b4c79 /gcc/gimple-range-path.cc | |
parent | 2f3d43a35155685b1795b4392e20e1c14a33c38f (diff) | |
download | gcc-dc777f6b0646fed2f18a580ce249cb6404f89205.zip gcc-dc777f6b0646fed2f18a580ce249cb6404f89205.tar.gz gcc-dc777f6b0646fed2f18a580ce249cb6404f89205.tar.bz2 |
path solver: Merge path_range_query constructors.
There's no need for two constructors, when we can do it all with one
that defaults to the common behavior:
path_range_query (bool resolve = true, gimple_ranger *ranger = NULL);
Tested on x86-64 Linux.
gcc/ChangeLog:
* gimple-range-path.cc (path_range_query::path_range_query): Merge
ctors.
(path_range_query::import_p): Move from header file.
(path_range_query::~path_range_query): Adjust for combined ctors.
* gimple-range-path.h: Merge ctors.
(path_range_query::import_p): Move to .cc file.
Diffstat (limited to 'gcc/gimple-range-path.cc')
-rw-r--r-- | gcc/gimple-range-path.cc | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index 71b2904..32b2cb5 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -36,33 +36,36 @@ along with GCC; see the file COPYING3. If not see // Internal construct to help facilitate debugging of solver. #define DEBUG_SOLVER (dump_file && (param_threader_debug == THREADER_DEBUG_ALL)) -path_range_query::path_range_query (gimple_ranger *ranger, bool resolve) +path_range_query::path_range_query (bool resolve, gimple_ranger *ranger) : m_cache (new ssa_global_cache), m_has_cache_entry (BITMAP_ALLOC (NULL)), - m_ranger (ranger), m_resolve (resolve), - m_alloced_ranger (false) + m_alloced_ranger (!ranger) { - m_oracle = new path_oracle (ranger->oracle ()); -} + if (m_alloced_ranger) + m_ranger = new gimple_ranger; + else + m_ranger = ranger; -path_range_query::path_range_query (bool resolve) - : m_cache (new ssa_global_cache), - m_has_cache_entry (BITMAP_ALLOC (NULL)), - m_ranger (new gimple_ranger), - m_resolve (resolve), - m_alloced_ranger (true) -{ m_oracle = new path_oracle (m_ranger->oracle ()); } path_range_query::~path_range_query () { - BITMAP_FREE (m_has_cache_entry); - delete m_cache; delete m_oracle; if (m_alloced_ranger) delete m_ranger; + BITMAP_FREE (m_has_cache_entry); + delete m_cache; +} + +// Return TRUE if NAME is in the import bitmap. + +bool +path_range_query::import_p (tree name) +{ + return (TREE_CODE (name) == SSA_NAME + && bitmap_bit_p (m_imports, SSA_NAME_VERSION (name))); } // Mark cache entry for NAME as unused. |