提交 a5236e9d 编写于 作者: N Niko Matsakis

add some comments

上级 068142a2
This is the code to load/save the dependency graph. Loading is assumed
to run early in compilation, and saving at the very end. When loading,
the basic idea is that we will load up the dependency graph from the
previous compilation and compare the hashes of our HIR nodes to the
hashes of the HIR nodes that existed at the time. For each node whose
hash has changed, or which no longer exists in the new HIR, we can
remove that node from the old graph along with any nodes that depend
on it. Then we add what's left to the new graph (if any such nodes or
edges already exist, then there would be no effect, but since we do
this first thing, they do not).
......@@ -10,7 +10,6 @@
//! Code to save/load the dep-graph from files.
use calculate_svh::SvhCalculate;
use rbml::{self, Doc};
use rbml::reader::{self, DecodeResult, Decoder};
......@@ -32,6 +31,12 @@
type CleanEdges = Vec<(DepNode<DefId>, DepNode<DefId>)>;
/// If we are in incremental mode, and a previous dep-graph exists,
/// then load up those nodes/edges that are still valid into the
/// dep-graph for this session. (This is assumed to be running very
/// early in compilation, before we've really done any work, but
/// actually it doesn't matter all that much.) See `README.md` for
/// more general overview.
pub fn load_dep_graph<'tcx>(tcx: &ty::TyCtxt<'tcx>) {
let _ignore = tcx.dep_graph.in_ignore();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册