Refactor: remove dead cross module includes#7574
Draft
Critsium-xy wants to merge 3 commits into
Draft
Conversation
Drop two dead includes that create needless reverse dependencies from
source_cell onto higher layers:
- source_estate/read_orb.h (elecstate::read_orb_file not used here;
the real user is read_atoms_helper.cpp)
- source_basis/module_ao/ORB_read.h (ORB / LCAO_Orbitals not used here)
Verified by compiling the `cell` target with ENABLE_LCAO=ON so the
former `#ifdef __LCAO` block was actually exercised.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Static scan + per-target compile verification identified 9 unused
includes that create reverse/lateral dependency edges between modules.
Removing them weakens the coupling without any behavior change:
io -> md input_conv.cpp (md_func.h)
estate -> lcao elecstate_energy_terms.cpp, elecstate_print.cpp
(module_deepks/LCAO_deepks.h)
lcao -> pw rdmft_tools.cpp (structure_factor.h),
wavefunc_in_pw.cpp (soc.h)
lcao -> io FORCE_gamma.cpp, FORCE_k.cpp (module_hs/write_HS.h)
pw -> io forces_cc.cpp, forces_scc.cpp (module_output/output_log.h)
Verified by building io_basic, elecstate, rdmft, hamilt_lcao and
module_pwdft (ENABLE_LCAO=ON) after removal; all link targets compile.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remove unused source_io includes across the esolver drivers. These are
on the allowed esolver->io direction, so this is include hygiene rather
than decoupling, but it trims 29 needless includes.
Verified three ways:
1. `make esolver` (ENABLE_LCAO=ON) recompiles all 21 TUs, 0 errors.
2. Feature-guarded headers checked explicitly since __RAPIDJSON,
__EXX/__LIBRI and __MLALGO are OFF in this build: the json
(init_info.h/output_info.h) and restart_exx_csr.h symbols are
unused in their consumers (Json::add_output_scf_mag in
esolver_ks.cpp comes from output_info.h, which is kept).
3. Whole-file precise-symbol sweep (incl. all #ifdef blocks) finds
no specific symbol of any removed header in its consumer.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.