Skip to content

Commit aee7748

Browse files
oli-obkmark-i-m
authored andcommitted
Add graphs that I forgot to push in the original PR
1 parent 81b0c84 commit aee7748

File tree

5 files changed

+447
-0
lines changed

5 files changed

+447
-0
lines changed

src/mir/construction.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ There are essentially four kinds of representations one might want of an express
9292
* `Operand` is an argument to e.g. a `+` operation or a function call
9393
* a temporary variable containing a copy of the value
9494

95+
These following image depicts a general overview of the interactions between the
96+
representations:
97+
98+
<img src="mir_overview.svg">
99+
100+
[Click here for a more detailed view](mir_detailed.svg)
101+
95102
We start out with lowering the function body to an `Rvalue` so we can create an
96103
assignment to `RETURN_PLACE`, This `Rvalue` lowering will in turn trigger lowering to
97104
`Operand` for its arguments (if any). `Operand` lowering either produces a `const`

src/mir/mir_detailed.dot

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
digraph G {
2+
Operand -> Constant
3+
Operand -> Place [taillabel="read"]
4+
Place -> Projection
5+
Projection -> Place
6+
Place -> LocalId
7+
Rvalue -> "Rvalue\nAggregate"
8+
Rvalue -> "Rvalue\nBinaryOp"
9+
Rvalue -> "Rvalue\nUnaryOp"
10+
Rvalue -> "Rvalue\n..."
11+
"Rvalue\nAggregate" -> Operand [headlabel="*"]
12+
"Rvalue\nBinaryOp" -> Operand [headlabel="2"]
13+
"Rvalue\nUnaryOp" -> Operand
14+
"Statement\nAssignment" -> Place [taillabel="write"]
15+
"Statement\nAssignment" -> Rvalue
16+
Statement -> "Statement\nAssignment"
17+
Statement -> "Statement\n..."
18+
Block -> Statement [headlabel="*"]
19+
Block -> Terminator
20+
Terminator -> "Terminator\nSwitchInt"
21+
"Terminator\nSwitchInt" -> Operand
22+
"Terminator\nSwitchInt" -> Constant [headlabel="*"]
23+
"Terminator\nSwitchInt" -> BlockId [headlabel="*"]
24+
Terminator -> "Terminator\n..."
25+
Mir -> Block [headlabel="*"]
26+
Mir -> Local [headlabel="*"]
27+
}

src/mir/mir_detailed.svg

Lines changed: 300 additions & 0 deletions
Loading

src/mir/mir_overview.dot

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
digraph G {
2+
Operand -> Constant
3+
Operand -> Place
4+
Place -> Projection
5+
Projection -> Place
6+
Place -> Local
7+
Rvalue -> Operand
8+
Assignment -> Place
9+
Assignment -> Operand
10+
}

0 commit comments

Comments
 (0)