Skip to main content

Module dep_graph

Module dep_graph 

Source
Expand description

Data types for the no-panic call graph.

The graph is constructed by the flux-opt crate (the call_graph query provider) but the types live here so they can be cached in flux-middle and consumed by both flux-opt (no-panic inference) and flux-refineck (the checker, which recovers the resolved callee at a call site by location).

Re-exportsΒ§

use std::fmt; πŸ”’
use std::fs; πŸ”’
use std::io; πŸ”’
use std::path::Path; πŸ”’
use flux_common::dbg::SpanTrace; πŸ”’
use rustc_data_structures::fx::FxIndexMap; πŸ”’
use rustc_data_structures::fx::FxIndexSet; πŸ”’
use rustc_data_structures::unord::UnordMap; πŸ”’
use rustc_hir::def::DefKind; πŸ”’
use rustc_hir::def_id::DefId; πŸ”’
use rustc_macros::TyDecodable; πŸ”’
use rustc_macros::TyEncodable; πŸ”’
use rustc_middle::mir::Location; πŸ”’
use rustc_middle::ty::GenericArgs; πŸ”’
use rustc_middle::ty::Instance; πŸ”’
use rustc_middle::ty::InstanceKind; πŸ”’
use rustc_middle::ty::TyCtxt; πŸ”’
use rustc_middle::ty::TypeVisitableExt; πŸ”’
use rustc_serialize::ContextOrd; πŸ”’
use serde::Serialize; πŸ”’
use serde::Serialize; πŸ”’
use toposort_scc::IndexGraph; πŸ”’

StructsΒ§

CallGraph
CallSite
A single call site observed in a function’s MIR body.
JsonNode

EnumsΒ§

CallSiteKind
Node
A node in the call graph. The node’s provenance (source item vs monomorphization) is carried by its NodeKey; the node itself only records, when it has an analyzable body, the call sites observed in it.
NodeKey
Identity of a call-graph node. Distinguishes an item as defined in source from a monomorphization synthesized while building the graph.

FunctionsΒ§

dump_dep_graph_json
Topologically sort def_ids by adj (deps before dependents) and emit as JSON to file_name inside dir.