<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>src/librustc_incremental/persist/README.md - fork/rust @ 1.39.0</title>
<meta name="description" content="src/librustc_incremental/persist/README.md in fork/rust at 1.39.0.">
<meta property="og:title" content="src/librustc_incremental/persist/README.md - fork/rust @ 1.39.0">
<meta property="og:description" content="src/librustc_incremental/persist/README.md in fork/rust at 1.39.0.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="1.39.0" data-tip="4560ea788cb760f0a34127156c78e2552949f734">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/rust</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/rust</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">bors</span><span class="commit-message" data-commit="4560ea788cb760f0a34127156c78e2552949f734">Auto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum</span><span class="snapshot-sha sha" data-commit="4560ea788cb760f0a34127156c78e2552949f734">4560ea788cb</span><time datetime="2019-11-04T15:43:19+00:00" title="2019-11-04 15:43:19 +0000">2019-11-04</time></p>
<header class="topbar"><details class="switcher"><summary>1.39.0</summary><div class="menu"><strong>branches</strong><a href="/fork/rust/ref/master/">master</a><strong>tags</strong><a class="current" href="/fork/rust/ref/1.39.0/">1.39.0</a><a href="/fork/rust/ref/1.40.0/">1.40.0</a><a href="/fork/rust/ref/1.41.0/">1.41.0</a><a href="/fork/rust/ref/1.41.1/">1.41.1</a><a href="/fork/rust/ref/1.42.0/">1.42.0</a><a href="/fork/rust/ref/1.43.0/">1.43.0</a><a href="/fork/rust/ref/1.43.1/">1.43.1</a><a href="/fork/rust/ref/1.44.0/">1.44.0</a><a class="all" href="/fork/rust/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/rust/">rust</a> / <a href="/fork/rust/ref/1.39.0/tree/src/">src</a> / <a href="/fork/rust/ref/1.39.0/tree/src/librustc_incremental/">librustc_incremental</a> / <a href="/fork/rust/ref/1.39.0/tree/src/librustc_incremental/persist/">persist</a> / <span class="cur">README.md</span></nav>
<span class="view-stats"><span>658 B</span><span>13 lines</span></span><span class="actions"><a class="raw" href="/fork/rust/raw/95e09400016395e34fccef4ad3305e64b033c81b/src/librustc_incremental/persist/README.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><p>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).</p>
</section><div class="code-panel"><pre class="code src" data-hl="src/librustc_incremental/persist/README.md"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text">This is the code to load/save the dependency graph. Loading is assumed</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text">to run early in compilation, and saving at the very end. When loading,</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">the basic idea is that we will load up the dependency graph from the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text">previous compilation and compare the hashes of our HIR nodes to the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text">hashes of the HIR nodes that existed at the time. For each node whose</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text">hash has changed, or which no longer exists in the new HIR, we can</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text">remove that node from the old graph along with any nodes that depend</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text">on it. Then we add what's left to the new graph (if any such nodes or</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text">edges already exist, then there would be no effect, but since we do</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text">this first thing, they do not).</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text"></span></span></pre></div></div>
</main>
</body>
</html>
