Skip to content

Commit

Permalink
- add baseline code
Browse files Browse the repository at this point in the history
- add title for ep20
  • Loading branch information
whtoo committed Dec 5, 2023
1 parent 0523e16 commit 5a647ff
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion ep20/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
# `CFG``地址化`为中心的编译构造实作

## 测试样例源码

``` CPP

int dec1(int x) {
return x - 1;
}

int main() {
int i = 10;
while(i > 0) {
if (i > 5) {
print(i);
if(i == 7) {
return 7;
}
}

print("break");

i = dec1(i);
}

return 0;
}



```
## 编译步骤流程图
```mermaid
Expand Down Expand Up @@ -26,6 +58,7 @@ graph LR
- [x] 编译到[ep18](..%2Fep18)的VM
- [x] 扩展[ep18](..%2Fep18)的VM支持更丰富的[指令实现](../ep18/VM_Design.md)
- [x] 线性化IR和CFG
- [x] 跳转优化(空标签和重复跳转)

### 线性化IR
我们的IR本质上是tree模式的,这样一来我们的线性化实际上延迟到了指令生成时。
Expand All @@ -34,7 +67,6 @@ graph LR

### CFG


- Original CFG
```mermaid
graph TD
Expand Down

0 comments on commit 5a647ff

Please sign in to comment.