Define HIR more specifically
IR is a foreign acronym to me, so having it fully expressed in the beginning as Intermediate Representation helps me comprehend the subject.
This commit is contained in:
parent
379ce9ae66
commit
75db8b32d4
|
|
@ -104,8 +104,8 @@ take:
|
|||
nodes, and hence may strip things out of the AST as well.
|
||||
3. **Lowering to HIR**
|
||||
- Once name resolution completes, we convert the AST into the HIR,
|
||||
or "high-level IR". The HIR is defined in `src/librustc/hir/`;
|
||||
that module also includes the lowering code.
|
||||
or "[high-level intermediate representation]". The HIR is defined in
|
||||
`src/librustc/hir/`; that module also includes the lowering code.
|
||||
- The HIR is a lightly desugared variant of the AST. It is more processed
|
||||
than the AST and more suitable for the analyses that follow.
|
||||
It is **not** required to match the syntax of the Rust language.
|
||||
|
|
@ -138,3 +138,4 @@ take:
|
|||
|
||||
|
||||
[query model]: query.html
|
||||
[high-level intermediate representation]: hir.html
|
||||
|
|
|
|||
10
src/hir.md
10
src/hir.md
|
|
@ -1,10 +1,10 @@
|
|||
# The HIR
|
||||
|
||||
The HIR – "High-level IR" – is the primary IR used in most of rustc. It is a
|
||||
compiler-friendly representation of the abstract syntax tree (AST) that is
|
||||
generated after parsing, macro expansion, and name resolution.
|
||||
Many parts of HIR resemble Rust surface syntax quite closely, with the
|
||||
exception that some of Rust's expression forms have been desugared away. For
|
||||
The HIR – "High-Level Intermediate Representation" – is the primary IR used in
|
||||
most of rustc. It is a compiler-friendly representation of the abstract syntax
|
||||
tree (AST) that is generated after parsing, macro expansion, and name
|
||||
resolution. Many parts of HIR resemble Rust surface syntax quite closely, with
|
||||
the exception that some of Rust's expression forms have been desugared away. For
|
||||
example, `for` loops are converted into a `loop` and do not appear in the HIR.
|
||||
This makes HIR more amenable to analysis than a normal AST.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue