Skip to content

Commit 4949ae7

Browse files
committed
[skip ci] doc: update generated wiki pages (wiki/Control Flow Graph.md)
1 parent 1c5709b commit 4949ae7

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

wiki/Control Flow Graph.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_This document was generated from '[src/documentation/wiki-cfg.ts](https://github.com/flowr-analysis/flowr/tree/main//src/documentation/wiki-cfg.ts)' on 2026-01-14, 16:35:27 UTC presenting an overview of flowR's control flow graph (v2.8.6, using R v4.5.0). Please do not edit this file/wiki page directly._
1+
_This document was generated from '[src/documentation/wiki-cfg.ts](https://github.com/flowr-analysis/flowr/tree/main//src/documentation/wiki-cfg.ts)' on 2026-01-15, 19:46:03 UTC presenting an overview of flowR's control flow graph (v2.8.6, using R v4.5.0). Please do not edit this file/wiki page directly._
22

33
_flowR_ produces three main perspectives of the program: 1) a [normalized version of the AST](https://github.com/flowr-analysis/flowr/wiki/Normalized-AST)
44
and 2) a [dataflow graph](https://github.com/flowr-analysis/flowr/wiki/Dataflow%20Graph), and 3) a control flow graph (CFG).
@@ -81,7 +81,7 @@ flowchart RL
8181
```
8282

8383

84-
_(The analysis required _2.2 ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
84+
_(The analysis required _2.7 ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
8585
We used the following simplification: `unique-cf-sets` .
8686
)_
8787

@@ -140,7 +140,7 @@ flowchart RL
140140

141141
<summary style="color:gray">R Code of the CFG</summary>
142142

143-
The analysis required _1.4 ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
143+
The analysis required _1.5 ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
144144
We used the following simplification: `unique-cf-sets` .
145145

146146

@@ -372,7 +372,7 @@ flowchart RL
372372

373373
<summary style="color:gray">R Code of the CFG</summary>
374374

375-
The analysis required _2.0 ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
375+
The analysis required _1.7 ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
376376
We used the following simplification: `unique-cf-sets` .
377377

378378

@@ -389,7 +389,7 @@ f()
389389

390390
<h2 id="cfg-structure">Structure of the Control Flow Graph</h2>
391391

392-
You can produce your very own control flow graph with <a href="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/extract-cfg.ts#L91"><code><span title="Given a normalized AST, this approximates the control flow graph of the program. This view is different from the computation of the dataflow graph and may differ, especially because it focuses on intra-procedural analysis.">extractCfg</span></code></a>.
392+
You can produce your very own control flow graph with <a href="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/extract-cfg.ts#L90"><code><span title="Given a normalized AST, this approximates the control flow graph of the program. This view is different from the computation of the dataflow graph and may differ, especially because it focuses on intra-procedural analysis.">extractCfg</span></code></a>.
393393
The <a href="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/control-flow-graph.ts#L211"><code><span title="This class represents the control flow graph of an R program. The control flow may be hierarchical when confronted with function definitions (see CfgSimpleVertex and rootVertexIds() ). There are two very simple visitors to traverse a CFG: - visitCfgInOrder visits the graph in the order of the vertices - visitCfgInReverseOrder visits the graph in reverse order If you want to prohibit modification, ...">ControlFlowGraph</span></code></a> class describes everything required to model the control flow graph, with its edge types described by
394394
<a href="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/control-flow-graph.ts#L129"><code>CfgEdge</code></a> and its vertices by <a href="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/control-flow-graph.ts#L86"><code><span title="A vertex in the ControlFlowGraph .">CfgSimpleVertex</span></code></a>.
395395
However, you should be aware of the <a href="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/control-flow-graph.ts#L466"><code><span title="Summarizes the control information of a program">ControlFlowInformation</span></code></a> interface which adds some additional information the CFG
@@ -430,7 +430,7 @@ However, you should be aware of the <a href="https://github.com/flowr-analysis/f
430430
To check whether the CFG has the expected shape, you can use the test function <a href="https://github.com/flowr-analysis/flowr/tree/main//test/functionality/_helper/controlflow/assert-control-flow-graph.ts#L35"><code><span title="Assert that the given code produces the expected CFG">assertCfg</span></code></a> which supports testing for
431431
sub-graphs as well (it provides diffing capabilities similar to <a href="https://github.com/flowr-analysis/flowr/tree/main//test/functionality/_helper/shell.ts#L394"><code><span title="Your best friend whenever you want to test whether the dataflow graph produced by flowR is as expected. You may want to have a look at the DataflowTestConfiguration to see what you can configure. Especially the resolveIdsAsCriterion and the expectIsSubgraph are interesting as they allow you for rather flexible matching of the expected graph. Pleas note, that if you pass context: 'call-graph' in th...">assertDataflow</span></code></a>).
432432
As the CFG may become unhandy for larger programs, there are simplifications available with <a href="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/cfg-simplification.ts#L39"><code><span title="Simplify the control flow information by applying the given passes. This may reduce the vertex count, in- and outgoing edges, entry and exit points, etc.">simplifyControlFlowInformation</span></code></a>
433-
(these can be passed on to the <a href="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/extract-cfg.ts#L91"><code><span title="Given a normalized AST, this approximates the control flow graph of the program. This view is different from the computation of the dataflow graph and may differ, especially because it focuses on intra-procedural analysis.">extractCfg</span></code></a> function as well).
433+
(these can be passed on to the <a href="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/extract-cfg.ts#L90"><code><span title="Given a normalized AST, this approximates the control flow graph of the program. This view is different from the computation of the dataflow graph and may differ, especially because it focuses on intra-procedural analysis.">extractCfg</span></code></a> function as well).
434434

435435
<h3 id="cfg-structure-vertices">CFG Vertices</h3>
436436

@@ -601,7 +601,7 @@ flowchart RL
601601
```
602602

603603

604-
_(The analysis required _1.6ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
604+
_(The analysis required _1.3ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
605605
We used the following simplification: `unique-cf-sets` .
606606
)_
607607

@@ -681,7 +681,7 @@ flowchart RL
681681

682682
<summary style="color:gray">R Code of the CFG</summary>
683683

684-
The analysis required _3.0ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
684+
The analysis required _1.3ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
685685
We used the following simplification: `unique-cf-sets` .
686686

687687

@@ -735,7 +735,7 @@ flowchart RL
735735

736736
<summary style="color:gray">R Code of the CFG</summary>
737737

738-
The analysis required _1.7ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
738+
The analysis required _1.6ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
739739
We used the following simplification: `unique-cf-sets` .
740740

741741

@@ -792,7 +792,7 @@ flowchart RL
792792

793793
<summary style="color:gray">R Code of the CFG</summary>
794794

795-
The analysis required _1.9ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
795+
The analysis required _1.8ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
796796
We used the following simplification: `unique-cf-sets` .
797797

798798

@@ -932,7 +932,7 @@ flowchart RL
932932

933933
<summary style="color:gray">R Code of the CFG</summary>
934934

935-
The analysis required _1.6ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
935+
The analysis required _1.7ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
936936
We used the following simplification: `unique-cf-sets` .
937937

938938

@@ -951,7 +951,7 @@ for(i in 1:10) b
951951

952952
<h4 id="cfg-call-links">Extra: Call Links</h4>
953953

954-
If you generate the CFG with the <a href="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/extract-cfg.ts#L91"><code><span title="Given a normalized AST, this approximates the control flow graph of the program. This view is different from the computation of the dataflow graph and may differ, especially because it focuses on intra-procedural analysis.">extractCfg</span></code></a> function you can (and, if you want to gain inter-procedural information, should)
954+
If you generate the CFG with the <a href="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/extract-cfg.ts#L90"><code><span title="Given a normalized AST, this approximates the control flow graph of the program. This view is different from the computation of the dataflow graph and may differ, especially because it focuses on intra-procedural analysis.">extractCfg</span></code></a> function you can (and, if you want to gain inter-procedural information, should)
955955
pass a matching [dataflow graph](https://github.com/flowr-analysis/flowr/wiki/Dataflow%20Graph) to it to incorporate the dataflow perspective into the CFG.
956956

957957
The difference becomes obvious when we look at the code `f <- function() b; f()` first without the dataflow graph:
@@ -1002,7 +1002,7 @@ flowchart RL
10021002

10031003
<summary style="color:gray">R Code of the CFG</summary>
10041004

1005-
The analysis required _1.6ms_ (including the normalization and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1005+
The analysis required _1.4ms_ (including the normalization and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
10061006
We used the following simplification: `unique-cf-sets` .
10071007

10081008

@@ -1124,7 +1124,7 @@ flowchart RL
11241124

11251125
<summary style="color:gray">R Code of the CFG</summary>
11261126

1127-
The analysis required _1.4ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1127+
The analysis required _1.7ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
11281128
We used the following simplification: `unique-cf-sets` .
11291129

11301130

@@ -1166,7 +1166,7 @@ print`"]
11661166

11671167
<summary style="color:gray">R Code of the Dataflow Graph</summary>
11681168

1169-
The analysis required _1.3ms_ (including parse and normalize, using the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1169+
The analysis required _1.4ms_ (including parse and normalize, using the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
11701170
We encountered unknown side effects (with ids: 3 (linked)) during the analysis.
11711171

11721172

@@ -1205,7 +1205,7 @@ x #60;#45; 2 #42; 3 #43; 1`"]]
12051205

12061206
<summary style="color:gray">R Code of the CFG</summary>
12071207

1208-
The analysis required _3.2ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1208+
The analysis required _1.9ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
12091209
We used the following simplifications: `unique-cf-sets`, `to-basic-blocks` and render a simplified/compacted version.
12101210

12111211

@@ -1261,7 +1261,7 @@ flowchart RL
12611261
```
12621262

12631263

1264-
_(The analysis required _1.7ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1264+
_(The analysis required _1.8ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
12651265
We used the following simplification: `unique-cf-sets` .
12661266
)_
12671267

@@ -1313,7 +1313,7 @@ flowchart RL
13131313
```
13141314

13151315

1316-
_(The analysis required _1.6ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1316+
_(The analysis required _2.0ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
13171317
We used the following simplifications: `unique-cf-sets`, `to-basic-blocks` .
13181318
)_
13191319

@@ -1393,7 +1393,7 @@ f(42)`"]]
13931393
```
13941394

13951395

1396-
_(The analysis required _10.4ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1396+
_(The analysis required _10.5ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
13971397
We used the following simplifications: `unique-cf-sets`, `to-basic-blocks` and render a simplified/compacted version.
13981398
)_
13991399

@@ -1652,7 +1652,7 @@ flowchart RL
16521652
```
16531653

16541654

1655-
_(The analysis required _6.7ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1655+
_(The analysis required _5.7ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
16561656
We used the following simplification: `unique-cf-sets` .
16571657
)_
16581658

0 commit comments

Comments
 (0)