Skip to content

Commit 55477c1

Browse files
marxintshepang
authored andcommitted
MIR docs: fix borked links and update style
Changes applied: - updating-llvm.md: make consistent style in a listing - CleanupNonCodegenStatements - renamed to CleanupPostBorrowck - SimplifyCfg - fix link target (it is an enum now) - LocalUseVisitor - replaced with another existing Visitor - PGO in LLVM - embed link
1 parent 0a92516 commit 55477c1

File tree

5 files changed

+20
-18
lines changed

5 files changed

+20
-18
lines changed

Diff for: src/backend/updating-llvm.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ the branch we're already using. The steps for this are:
3434
2. Identify the branch that rustc is currently using. The `src/llvm-project`
3535
submodule is always pinned to a branch of the
3636
[rust-lang/llvm-project repository].
37-
3. Fork the rust-lang/llvm-project repository
38-
4. Check out the appropriate branch (typically named `rustc/a.b-yyyy-mm-dd`)
39-
5. Cherry-pick the upstream commit onto the branch
40-
6. Push this branch to your fork
37+
3. Fork the rust-lang/llvm-project repository.
38+
4. Check out the appropriate branch (typically named `rustc/a.b-yyyy-mm-dd`).
39+
5. Cherry-pick the upstream commit onto the branch.
40+
6. Push this branch to your fork.
4141
7. Send a Pull Request to rust-lang/llvm-project to the same branch as before.
4242
Be sure to reference the Rust and/or LLVM issue that you're fixing in the PR
4343
description.
44-
8. Wait for the PR to be merged
44+
8. Wait for the PR to be merged.
4545
9. Send a PR to rust-lang/rust updating the `src/llvm-project` submodule with
4646
your bugfix. This can be done locally with `git submodule update --remote
4747
src/llvm-project` typically.
48-
10. Wait for PR to be merged
48+
10. Wait for PR to be merged.
4949

5050
An example PR:
5151
[#59089](https://github.com/rust-lang/rust/pull/59089)

Diff for: src/mir/optimizations.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ implemented in its own module of the [`rustc_mir_transform`][trans] crate.
8888
[trans]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/index.html
8989

9090
Some examples of passes are:
91-
- `CleanupNonCodegenStatements`: remove some of the info that is only needed for
91+
- `CleanupPostBorrowck`: Remove some of the info that is only needed for
9292
analyses, rather than codegen.
93-
- `ConstProp`: Does [constant propagation][constprop]
93+
- `ConstProp`: Does [constant propagation][constprop].
9494

9595
You can see the ["Implementors" section of the `MirPass` rustdocs][impl] for more examples.
9696

Diff for: src/mir/passes.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ this pass into the appropriate list of passes found in a query like
5353
`mir_built`, `optimized_mir`, etc. (If this is an optimization, it
5454
should go into the `optimized_mir` list.)
5555

56-
Another example of a simple MIR pass is [`CleanupNonCodegenStatements`][cleanup-pass], which walks
56+
Another example of a simple MIR pass is [`CleanupPostBorrowck`][cleanup-pass], which walks
5757
the MIR and removes all statements that are not relevant to code generation. As you can see from
5858
its [source][cleanup-source], it is defined by first defining a dummy type, a struct with no
5959
fields:
6060

6161
```rust
62-
pub struct CleanupNonCodegenStatements;
62+
pub struct CleanupPostBorrowck;
6363
```
6464

6565
for which we implement the `MirPass` trait:
6666

6767
```rust
68-
impl<'tcx> MirPass<'tcx> for CleanupNonCodegenStatements {
68+
impl<'tcx> MirPass<'tcx> for CleanupPostBorrowck {
6969
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
7070
...
7171
}
@@ -172,11 +172,11 @@ simply loads from a cache the second time).
172172
[lint1]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/check_packed_ref/struct.CheckPackedRef.html
173173
[lint2]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/check_const_item_mutation/struct.CheckConstItemMutation.html
174174
[lint3]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/function_item_references/struct.FunctionItemReferences.html
175-
[opt1]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/simplify/struct.SimplifyCfg.html
175+
[opt1]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/simplify/enum.SimplifyCfg.html
176176
[opt2]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/remove_unneeded_drops/struct.RemoveUnneededDrops.html
177177
[mirtransform]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/
178178
[`RemoveStorageMarkers`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/remove_storage_markers/struct.RemoveStorageMarkers.html
179-
[cleanup-pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/cleanup_post_borrowck/struct.CleanupNonCodegenStatements.html
179+
[cleanup-pass]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/cleanup_post_borrowck/struct.CleanupPostBorrowck.html
180180
[cleanup-source]: https://github.com/rust-lang/rust/blob/e2b52ff73edc8b0b7c74bc28760d618187731fe8/compiler/rustc_mir_transform/src/cleanup_post_borrowck.rs#L27
181181
[pass-register]: https://github.com/rust-lang/rust/blob/e2b52ff73edc8b0b7c74bc28760d618187731fe8/compiler/rustc_mir_transform/src/lib.rs#L413
182182
[MIR visitor]: ./visitor.html

Diff for: src/mir/visitor.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ code that will execute whenever a `foo` is found. If you want to
3737
recursively walk the contents of the `foo`, you then invoke the
3838
`super_foo` method. (NB. You never want to override `super_foo`.)
3939

40-
A very simple example of a visitor can be found in [`LocalUseVisitor`].
41-
By implementing `visit_local` method, this visitor counts how many times each local is mutably used.
40+
A very simple example of a visitor can be found in [`LocalFinder`].
41+
By implementing `visit_local` method, this visitor identifies local variables that
42+
can be candidates for reordering.
4243

43-
[`LocalUseVisitor`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/const_debuginfo/struct.LocalUseVisitor.html
44+
-[`LocalFinder`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/prettify/struct.LocalFinder.html
4445

4546
## Traversal
4647

Diff for: src/profile-guided-optimization.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,6 @@ instrumentation artifacts show up in LLVM IR.
136136

137137
## Additional Information
138138

139-
Clang's documentation contains a good overview on PGO in LLVM here:
140-
https://clang.llvm.org/docs/UsersManual.html#profile-guided-optimization
139+
Clang's documentation contains a good overview on [PGO in LLVM][llvm-pgo].
140+
141+
[llvm-pgo]: https://clang.llvm.org/docs/UsersManual.html#profile-guided-optimization

0 commit comments

Comments
 (0)