File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -104,8 +104,8 @@ take:
104
104
nodes, and hence may strip things out of the AST as well.
105
105
3 . ** Lowering to HIR**
106
106
- Once name resolution completes, we convert the AST into the HIR,
107
- or "high-level IR ". The HIR is defined in ` src/librustc/hir/ ` ;
108
- that module also includes the lowering code.
107
+ or "[ high-level intermediate representation ] ". The HIR is defined in
108
+ ` src/librustc/hir/ ` ; that module also includes the lowering code.
109
109
- The HIR is a lightly desugared variant of the AST. It is more processed
110
110
than the AST and more suitable for the analyses that follow.
111
111
It is ** not** required to match the syntax of the Rust language.
@@ -138,3 +138,4 @@ take:
138
138
139
139
140
140
[ query model ] : query.html
141
+ [ high-level intermediate representation ] : hir.html
Original file line number Diff line number Diff line change 1
1
# The HIR
2
2
3
- The HIR – "High-level IR " – is the primary IR used in most of rustc. It is a
4
- compiler-friendly representation of the abstract syntax tree (AST) that is
5
- generated after parsing, macro expansion, and name resolution.
6
- Many parts of HIR resemble Rust surface syntax quite closely, with the
7
- exception that some of Rust's expression forms have been desugared away. For
3
+ The HIR – "High-Level Intermediate Representation " – is the primary IR used in
4
+ most of rustc. It is a compiler-friendly representation of the abstract syntax
5
+ tree (AST) that is generated after parsing, macro expansion, and name
6
+ resolution. Many parts of HIR resemble Rust surface syntax quite closely, with
7
+ the exception that some of Rust's expression forms have been desugared away. For
8
8
example, ` for ` loops are converted into a ` loop ` and do not appear in the HIR.
9
9
This makes HIR more amenable to analysis than a normal AST.
10
10
You can’t perform that action at this time.
0 commit comments