Skip to main content

backhopper_xref/
lib.rs

1// Copyright (C) 2026 Michael S. Klishin and Contributors
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3// See LICENSE-APACHE and LICENSE-MIT for details.
4
5//! Whole-program cross-reference analysis for Erlang projects.
6//!
7//! This is the consumer-facing façade. Build an [`Xref`] with
8//! [`XrefBuilder`], then run [predefined analyses](analysis) (dead-export
9//! detection, behaviour conformance, cycle detection).
10//!
11//! The test-suite-selection adapter [`suites`] consumes the graph to
12//! answer "which `_SUITE` modules should I run for this diff?".
13
14pub mod analysis;
15pub mod builder;
16pub mod display;
17pub mod errors;
18pub mod result;
19pub mod suites;
20pub mod xref;
21
22pub use builder::XrefBuilder;
23pub use errors::XrefError;
24pub use result::{
25    AnalysisResult, AppDependencies, CalleeEntry, CalleesOf, CallerEntry, CallersOf,
26    DeprecatedCall, DeprecatedFunctionCalls, ExportsNotUsed, LocalsNotUsed, ModuleCallers,
27    ModuleDependencies, NonConformance, UndefinedFunctionCall, UndefinedFunctionCalls,
28    UnresolvedCalls, UnusedExport, UnusedLocal,
29};
30pub use suites::{SuiteRef, is_suite_module, suites_referencing, suites_referencing_mfas};
31pub use xref::Xref;
32
33pub use backhopper_xref_graph::{
34    CallGraph, CallKind, CallTarget, Deprecation, DeprecationTier, FunctionRef, FunctionSig,
35    Functions, Loc, Modules, Position, Relation, Vertex, VertexSet,
36};
37pub use backhopper_xref_reader::{
38    ApplicationAssignment, ModuleData, ProjectLayout, ReadError, ReadOutput, ReadWarning,
39    SourceReader,
40};