Skip to content
Snippets Groups Projects
  • Nathaniel Shead's avatar
    0de1481a
    c++/modules: Assume header bindings are global module · 0de1481a
    Nathaniel Shead authored
    
    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: default avatarNathaniel Shead <nathanieloshead@gmail.com>
    0de1481a
    History
    c++/modules: Assume header bindings are global module
    Nathaniel Shead authored
    
    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: default avatarNathaniel Shead <nathanieloshead@gmail.com>