File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
src/librustc_incremental/persist Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1+ This is the code to load/save the dependency graph. Loading is assumed
2+ to run early in compilation, and saving at the very end. When loading,
3+ the basic idea is that we will load up the dependency graph from the
4+ previous compilation and compare the hashes of our HIR nodes to the
5+ hashes of the HIR nodes that existed at the time. For each node whose
6+ hash has changed, or which no longer exists in the new HIR, we can
7+ remove that node from the old graph along with any nodes that depend
8+ on it. Then we add what's left to the new graph (if any such nodes or
9+ edges already exist, then there would be no effect, but since we do
10+ this first thing, they do not).
11+
12+
13+
Original file line number Diff line number Diff line change 1010
1111//! Code to save/load the dep-graph from files.
1212
13-
1413use calculate_svh:: SvhCalculate ;
1514use rbml:: { self , Doc } ;
1615use rbml:: reader:: { self , DecodeResult , Decoder } ;
@@ -32,6 +31,12 @@ type DirtyNodes = FnvHashSet<DepNode<DefId>>;
3231
3332type CleanEdges = Vec < ( DepNode < DefId > , DepNode < DefId > ) > ;
3433
34+ /// If we are in incremental mode, and a previous dep-graph exists,
35+ /// then load up those nodes/edges that are still valid into the
36+ /// dep-graph for this session. (This is assumed to be running very
37+ /// early in compilation, before we've really done any work, but
38+ /// actually it doesn't matter all that much.) See `README.md` for
39+ /// more general overview.
3540pub fn load_dep_graph < ' tcx > ( tcx : & ty:: TyCtxt < ' tcx > ) {
3641 let _ignore = tcx. dep_graph . in_ignore ( ) ;
3742
You can’t perform that action at this time.
0 commit comments