diff options
author | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-08-08 22:00:07 +1000 |
---|---|---|
committer | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-08-08 22:42:13 +1000 |
commit | 0de1481a9d91e936135da4f882314499eea38a36 (patch) | |
tree | 46a5190b430c3621e7c4ff98dff22fe27b08b3e7 /gcc | |
parent | 8b5a8b1f60e7d1a51429f118e0fb3d851abe6cd4 (diff) | |
download | gcc-0de1481a9d91e936135da4f882314499eea38a36.zip gcc-0de1481a9d91e936135da4f882314499eea38a36.tar.gz gcc-0de1481a9d91e936135da4f882314499eea38a36.tar.bz2 |
c++/modules: Assume header bindings are global module
While stepping through some code I noticed that we do some extra work
(finding the originating module decl, stripping the template, and
inspecting the attached-ness) for every declaration taken from a header
unit. This doesn't seem necessary though since no declaration in a
header unit can be attached to anything but the global module, so we can
just assume that global_p will be true.
This was the original behaviour before I removed this assumption while
refactoring for r15-2807-gc592310d5275e0.
gcc/cp/ChangeLog:
* module.cc (module_state::read_cluster): Assume header module
declarations will require GM merging.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/module.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 58ad8cb..f4d137b 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -15361,7 +15361,7 @@ module_state::read_cluster (unsigned snum) tree visible = NULL_TREE; tree type = NULL_TREE; bool dedup = false; - bool global_p = false; + bool global_p = is_header (); /* We rely on the bindings being in the reverse order of the resulting overload set. */ |