Skip to content

Commit 1838d29

Browse files
JohnTitorJoshua Nelson
authored and
Joshua Nelson
committed
Fix some link failures and typos
1 parent a6a9c67 commit 1838d29

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/llvm-coverage-instrumentation.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ code branches, and injects additional [`Coverage`][coverage-statement]
7575
statements into the `BasicBlock`s.
7676

7777
A MIR `Coverage` statement is a virtual instruction that indicates a counter
78-
should be incremented when its adjacent statemeents are executed, to count
78+
should be incremented when its adjacent statements are executed, to count
7979
a span of code ([`CodeRegion`][code-region]). It counts the number of times a
8080
branch is executed, and also specifies the exact location of that code span in
8181
the Rust source code.
@@ -181,7 +181,7 @@ MIR `Statement` into some backend-specific action or instruction.
181181
CoverageKind::Unreachable => {
182182
...
183183
```
184-
_[code snippet trimmed for brevity]_
184+
_code snippet trimmed for brevity_
185185

186186
> The function name `instrprof_increment()` is taken from the LLVM intrinsic
187187
call of the same name ([`llvm.instrprof.increment`][llvm-instrprof-increment]),
@@ -206,7 +206,7 @@ the last remaining step is to inject the LLVM IR variables that hold the
206206
static data for the coverage map.
207207

208208
`rustc_codegen_llvm`'s [`compile_codegen_unit()`][compile-codegen-unit] calls
209-
[`coverageinfo_finalze()`][coverageinfo-finalize],
209+
[`coverageinfo_finalize()`][coverageinfo-finalize],
210210
which delegates its implementation to the
211211
[`rustc_codegen_llvm::coverageinfo::mapgen`][mapgen-finalize] module.
212212

@@ -247,9 +247,9 @@ pub fn finalize<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) {
247247
mapgen.write_coverage_mapping(expressions, counter_regions, coverage_mapping_buffer);
248248
});
249249
```
250-
_[code snippet trimmed for brevity]_
250+
_code snippet trimmed for brevity_
251251

252-
One noteable step, performed by `mapgen::finalize()` before processing the
252+
One notable step, performed by `mapgen::finalize()` before processing the
253253
`Instance`s and their `FunctionCoverage`s, is the call to
254254
[`add_unreachable_functions()`][add-unreachable-coverage].
255255

@@ -262,7 +262,7 @@ The set of unreachable functions is computed via the set difference of all MIR
262262
`DefId`s (`tcx` query `mir_keys`) minus the codegenned `DefId`s
263263
(`tcx` query `collect_and_partition_mono_items`). `add_unreachable_functions()`
264264
computes the set of unreachable functions, queries the `tcx` for the
265-
previously-computed `CodeRegions`, for each unreachabe MIR, and adds those code
265+
previously-computed `CodeRegions`, for each unreachable MIR, and adds those code
266266
regions to one of the non-generic codegenned functions (non-generic avoids
267267
potentially injecting the unreachable coverage multiple times for multiple
268268
instantiations).
@@ -382,7 +382,7 @@ fundamental control flow, with many of the same
382382
For anyone that knows how to work with the [MIR, as a CFG][mir-dev-guide], the
383383
`CoverageGraph` will be familiar, and can be used in much the same way.
384384
The nodes of the `CoverageGraph` are `BasicCoverageBlock`s (BCBs), which
385-
index into an `IndexVec` of `BasicCoverageBlockData`. This is analagous
385+
index into an `IndexVec` of `BasicCoverageBlockData`. This is analogous
386386
to the MIR CFG of `BasicBlock`s that index `BasicBlockData`.
387387

388388
Each `BasicCoverageBlockData` captures one or more MIR `BasicBlock`s,
@@ -450,7 +450,7 @@ The nodes contain information in sections:
450450
its `BasicCoverageBlockData`).
451451
2. The first content section shows the assigned `Counter` or `Expression` for
452452
each contiguous section of code. (There may be more than one `Expression`
453-
incremented by the same `Counter` for discontigous sections of code representing
453+
incremented by the same `Counter` for discontiguous sections of code representing
454454
the same sequential actions.) Note the code is represented by the line and
455455
column ranges (for example: `52:28-52:33`, representing the original source
456456
line 52, for columns 28-33). These are followed by the MIR `Statement` or
@@ -489,7 +489,7 @@ an initial set of `CoverageSpan`s from the `Span`s associated with each MIR
489489

490490
The final stage of `generate_coverage_spans()` is handled by
491491
[`to_refined_spans()`][to-refined-spans], which iterates through the `CoverageSpan`s,
492-
merges and de-duplicates them, and returns an optimial, minimal set of `CoverageSpan`s
492+
merges and de-duplicates them, and returns an optimal, minimal set of `CoverageSpan`s
493493
that can be used to assign coverage `Counter`s or `Expression`s, one-for-one.
494494

495495
An visual, interactive representation of the final `CoverageSpan`s can be

src/profile-guided-optimization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ workflow to see how they interact.
4747

4848
[^note-instrument-coverage]: Note: `rustc` now supports front-end-based coverage
4949
instrumentation, via the experimental option
50-
[`-Z instrument-coverage`](../llvm-coverage-instrumentation), but using these
50+
[`-Z instrument-coverage`](./llvm-coverage-instrumentation.md), but using these
5151
coverage results for PGO has not been attempted at this time.
5252

5353
### Overall Workflow

0 commit comments

Comments
 (0)