Added links back to nrc's stupid-stats
This commit is contained in:
parent
856aa3adff
commit
e19b1e23b5
|
|
@ -1,5 +1,10 @@
|
||||||
# Appendix A: A tutorial on creating a drop-in replacement for rustc
|
# Appendix A: A tutorial on creating a drop-in replacement for rustc
|
||||||
|
|
||||||
|
> **Note:** This is a copy of `@nrc`'s amazing [stupid-stats]. You should find
|
||||||
|
> a copy of the code on the GitHub repository although due to the compiler's
|
||||||
|
> constantly evolving nature, there is no guarantee it'll compile on the first
|
||||||
|
> go.
|
||||||
|
|
||||||
Many tools benefit from being a drop-in replacement for a compiler. By this, I
|
Many tools benefit from being a drop-in replacement for a compiler. By this, I
|
||||||
mean that any user of the tool can use `mytool` in all the ways they would
|
mean that any user of the tool can use `mytool` in all the ways they would
|
||||||
normally use `rustc` - whether manually compiling a single file or as part of a
|
normally use `rustc` - whether manually compiling a single file or as part of a
|
||||||
|
|
@ -395,4 +400,6 @@ It'd be great to see Rustdoc converted to using these APIs, if that is possible
|
||||||
analysis, rather than doing its own analysis). Other parts of the compiler
|
analysis, rather than doing its own analysis). Other parts of the compiler
|
||||||
(e.g., pretty printing, testing) could be refactored to use these APIs
|
(e.g., pretty printing, testing) could be refactored to use these APIs
|
||||||
internally (I already changed save-analysis to use `CompilerController`). I've
|
internally (I already changed save-analysis to use `CompilerController`). I've
|
||||||
been experimenting with a prototype rustfmt which also uses these APIs.
|
been experimenting with a prototype rustfmt which also uses these APIs.
|
||||||
|
|
||||||
|
[stupid-stats]: https://github.com/nrc/stupid-stats
|
||||||
|
|
@ -39,6 +39,9 @@ compilation process
|
||||||
The `CompileState`'s various `state_after_*()` constructors can be inspected to
|
The `CompileState`'s various `state_after_*()` constructors can be inspected to
|
||||||
determine what bits of information are available to which callback.
|
determine what bits of information are available to which callback.
|
||||||
|
|
||||||
|
For a more detailed explanation on using `rustc_driver`, check out the
|
||||||
|
[stupid-stats] guide by `@nrc` (attached as [Appendix A]).
|
||||||
|
|
||||||
> **Warning:** By its very nature, the internal compiler APIs are always going
|
> **Warning:** By its very nature, the internal compiler APIs are always going
|
||||||
> to be unstable. That said, we do try not to break things unnecessarily.
|
> to be unstable. That said, we do try not to break things unnecessarily.
|
||||||
|
|
||||||
|
|
@ -68,4 +71,6 @@ thread-locals, although you should rarely need to touch it.
|
||||||
[`CompileState`]: https://github.com/rust-lang/rust/blob/master/src/librustc_driver/driver.rs
|
[`CompileState`]: https://github.com/rust-lang/rust/blob/master/src/librustc_driver/driver.rs
|
||||||
[`Session`]: https://github.com/rust-lang/rust/blob/master/src/librustc/session/mod.rs
|
[`Session`]: https://github.com/rust-lang/rust/blob/master/src/librustc/session/mod.rs
|
||||||
[`TyCtxt`]: https://github.com/rust-lang/rust/blob/master/src/librustc/ty/context.rs
|
[`TyCtxt`]: https://github.com/rust-lang/rust/blob/master/src/librustc/ty/context.rs
|
||||||
[`CodeMap`]: https://github.com/rust-lang/rust/blob/master/src/libsyntax/codemap.rs
|
[`CodeMap`]: https://github.com/rust-lang/rust/blob/master/src/libsyntax/codemap.rs
|
||||||
|
[stupid-stats]: https://github.com/nrc/stupid-stats
|
||||||
|
[Appendix A]: appendix-stupid-stats.html
|
||||||
Loading…
Reference in New Issue