We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0a303c4 commit fa037e2Copy full SHA for fa037e2
2 files changed
_posts/2025-03-10-Control-Flow-Graph.md
@@ -7,7 +7,7 @@ math: true
7
---
8
9
10
-# Control Flow Graph (CFG) - Program Analysis
+# Control Flow Graph (CFG)
11
12
## Overview
13
A **Control Flow Graph (CFG)** 是程序计算和控制流的图表示。用于建模程序的执行路径,是静态分析的核心。
@@ -55,4 +55,24 @@ clang -fdump-tree-cfg my_program.cpp
55
### 工具2 clang Static Analyzer
56
```bash
57
clang --analyze my_program.cpp
58
-```
+```
59
+
60
+# 数据流图(data flow graph, DFG)
61
62
+图数据流图(DFG,Data Flow Graph)是一种图形化表示,用于描述程序中数据之间的流动和依赖关系。每个节点通常表示一个操作或计算,每条边表示数据的流动和依赖。
63
+```cpp
64
+quad( a, b, c)
65
+t1 = a*c;
66
+t2 = 4*t1;
67
+t3 = b*b;
68
+t4 = t3 - t2;
69
+t5 = sqrt( t4);
70
+t6 = -b;
71
+t7 = t6 - t5;
72
+t8 = t7 + t5;
73
+t9 = 2*a;
74
+r1 = t7/t9;
75
+r2 = t8/t9;
76
77
78
+
assets/LLM/dfg.gif
3.09 KB
0 commit comments