about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2020-04-20 10:33:27 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2020-04-20 15:48:19 -0400
commita00194ec00062efde783730efd4dfe59161a7651 (patch)
tree8008911848eec1c6f2fa65c7a0488ac1b0c43975
parent2b08d7ff30882f22223bc813b9e3bf5e25ab885d (diff)
downloadrust-a00194ec00062efde783730efd4dfe59161a7651.tar.gz
rust-a00194ec00062efde783730efd4dfe59161a7651.zip
Expand comment to justify not checking if all the exports are green.
-rw-r--r--src/librustc_codegen_llvm/back/lto.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/back/lto.rs b/src/librustc_codegen_llvm/back/lto.rs
index 329b0a837ab..ee56d0e26c3 100644
--- a/src/librustc_codegen_llvm/back/lto.rs
+++ b/src/librustc_codegen_llvm/back/lto.rs
@@ -509,6 +509,23 @@ fn thin_lto(
             // (Note that globally, the export set is just the inverse of the
             // import set.)
             //
+            // For further justification of why the above is necessary and sufficient,
+            // see the LLVM blog post on ThinLTO:
+            //
+            // http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html
+            //
+            // which states the following:
+            //
+            // ```quote
+            // any particular ThinLTO backend must be redone iff:
+            //
+            // 1. The corresponding (primary) module’s bitcode changed
+            // 2. The list of imports into or exports from the module changed
+            // 3. The bitcode for any module being imported from has changed
+            // 4. Any global analysis result affecting either the primary module
+            //    or anything it imports has changed.
+            // ```
+            //
             // This strategy means we can always save the computed imports as
             // canon: when we reuse the post-ThinLTO version, condition (3.)
             // ensures that the current import set is the same as the previous