Skip to content

Commit 622730c

Browse files
Remove some out-dated comments from CGU partitioning docs.
1 parent 5f90947 commit 622730c

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

src/librustc_trans/partitioning.rs

+3-17
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353
//! - One for "stable", that is non-generic, code
5454
//! - One for more "volatile" code, i.e. monomorphized instances of functions
5555
//! defined in that module
56-
//! - Code for monomorphized instances of functions from external crates gets
57-
//! placed into every codegen unit that uses that instance.
5856
//!
5957
//! In order to see why this heuristic makes sense, let's take a look at when a
6058
//! codegen unit can get invalidated:
@@ -82,17 +80,6 @@
8280
//! side-effect of references a little by at least not touching the non-generic
8381
//! code of the module.
8482
//!
85-
//! As another optimization, monomorphized functions from external crates get
86-
//! some special handling. Since we assume that the definition of such a
87-
//! function changes rather infrequently compared to local items, we can just
88-
//! instantiate external functions in every codegen unit where it is referenced
89-
//! -- without having to fear that doing this will cause a lot of unnecessary
90-
//! re-compilations. If such a reference is added or removed, the codegen unit
91-
//! has to be re-translated anyway.
92-
//! (Note that this only makes sense if external crates actually don't change
93-
//! frequently. For certain multi-crate projects this might not be a valid
94-
//! assumption).
95-
//!
9683
//! A Note on Inlining
9784
//! ------------------
9885
//! As briefly mentioned above, in order for LLVM to be able to inline a
@@ -107,10 +94,9 @@
10794
//! inlined, so it can distribute function instantiations accordingly. Since
10895
//! there is no way of knowing for sure which functions LLVM will decide to
10996
//! inline in the end, we apply a heuristic here: Only functions marked with
110-
//! #[inline] and (as stated above) functions from external crates are
111-
//! considered for inlining by the partitioner. The current implementation
112-
//! will not try to determine if a function is likely to be inlined by looking
113-
//! at the functions definition.
97+
//! #[inline] are considered for inlining by the partitioner. The current
98+
//! implementation will not try to determine if a function is likely to be
99+
//! inlined by looking at the functions definition.
114100
//!
115101
//! Note though that as a side-effect of creating a codegen units per
116102
//! source-level module, functions from the same module will be available for

0 commit comments

Comments
 (0)