Skip to main content

fix_includes

Function fix_includes 

Source
pub fn fix_includes<S: BuildHasher>(
    files: &mut HashMap<PathBuf, PreprocFile, S>,
    all_files: &HashMap<String, Vec<PathBuf>, S>,
)
Expand description

Constructs a dependency graph of the include directives in a C/C++ file.

The dependency graph is built using both preprocessor data and not extracted from the considered C/C++ files.

§Panics

Panics if any of the lockstep invariants between the include graph g, the nodes map, and the scc_map is violated at runtime — specifically: an SCC component node missing from the graph, a graph node weight without a nodes map entry, a DFS-visited node without a stored weight, or an empty-path replacement node without a scc_map entry. These data structures are built in lockstep by this function, so all four conditions represent unrecoverable programmer errors rather than reachable input failures.