Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow analysis rework #508

Merged
merged 125 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
f414d0d
Update FlowAnalysisErrors.cs
LPeter1997 Oct 12, 2024
734b5c7
Removed old crap
LPeter1997 Oct 12, 2024
aa91480
Update FlowAnalysisTests.cs
LPeter1997 Oct 12, 2024
48ebe5e
Create FlowAnalysisPass.cs
LPeter1997 Oct 12, 2024
4c9110b
Delete FlowAnalysisPass.cs
LPeter1997 Oct 12, 2024
4c2d20a
Basic CFG
LPeter1997 Oct 12, 2024
bdd675a
More elaborate interfaces
LPeter1997 Oct 13, 2024
285e264
Create ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
4e9014c
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
62cc647
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
2a05d81
Merge branch 'main' into flow-analysis-rework
LPeter1997 Oct 13, 2024
fa938fe
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
9f8a6ab
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
81c2cfe
Slight fix
LPeter1997 Oct 13, 2024
0d12cdc
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
2ee7c42
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
4476f65
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
be23318
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
455c2e9
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
0528cd8
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
d331c8a
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
4137c14
Done
LPeter1997 Oct 13, 2024
bf1357c
Added ToDot
LPeter1997 Oct 13, 2024
6b006b7
Turned off flow analysis temporarily
LPeter1997 Oct 13, 2024
78e3ad8
Fixes
LPeter1997 Oct 13, 2024
ae65f5f
Update SourceFunctionSymbol.cs
LPeter1997 Oct 13, 2024
27efdda
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
bf3856d
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
29da540
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 13, 2024
7b48b9b
Update ControlFlowGraph.cs
LPeter1997 Oct 13, 2024
46a9ebf
YEET
LPeter1997 Oct 14, 2024
d4c759d
Revert "YEET"
LPeter1997 Oct 15, 2024
d7bdb18
Edge info added
LPeter1997 Oct 15, 2024
0239f7d
Update ControlFlowGraph.cs
LPeter1997 Oct 15, 2024
296cef4
Update FlowCondition.cs
LPeter1997 Oct 15, 2024
635ea97
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 15, 2024
810eb48
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 15, 2024
847ead4
Update Template.cs
LPeter1997 Oct 15, 2024
a4238dc
Update ControlFlowGraph.cs
LPeter1997 Oct 15, 2024
99ed69e
Update ControlFlowGraph.cs
LPeter1997 Oct 15, 2024
9a67f0c
Inlining
LPeter1997 Oct 15, 2024
f588c25
Added exit point
LPeter1997 Oct 16, 2024
c0b07c1
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 16, 2024
604409c
Create FlowDomain.cs
LPeter1997 Oct 16, 2024
9f8f139
Create FlowAnalysis.cs
LPeter1997 Oct 16, 2024
28ccf02
Update FlowAnalysis.cs
LPeter1997 Oct 16, 2024
7822465
Update FlowDomain.cs
LPeter1997 Oct 16, 2024
efd2408
Added analysis passes
LPeter1997 Oct 16, 2024
04fa77f
Update FlowDomain.cs
LPeter1997 Oct 16, 2024
9d1e316
Update FlowDomain.cs
LPeter1997 Oct 16, 2024
1d57f0c
Update FlowAnalysis.cs
LPeter1997 Oct 16, 2024
fe181c7
Added definite assignment
LPeter1997 Oct 16, 2024
8fc26eb
Update FlowAnalysis.cs
LPeter1997 Oct 17, 2024
0d2a173
Update SourceFunctionSymbol.cs
LPeter1997 Oct 17, 2024
fb56f78
Update FlowAnalysis.cs
LPeter1997 Oct 17, 2024
fb0b0d8
Update ControlFlowGraph.cs
LPeter1997 Oct 17, 2024
ee0dde7
Tweaks
LPeter1997 Oct 18, 2024
ebf732e
Update FlowDomain.cs
LPeter1997 Oct 18, 2024
c9ab3c0
Update FlowAnalysis.cs
LPeter1997 Oct 18, 2024
bc97aaf
Update FlowAnalysis.cs
LPeter1997 Oct 18, 2024
99b6a2d
Completed API
LPeter1997 Oct 19, 2024
bbd2e69
Moved todot
LPeter1997 Oct 19, 2024
3bbb7f6
Update ControlFlowGraphToDot.cs
LPeter1997 Oct 19, 2024
aef1796
Added optional stringification of domain state
LPeter1997 Oct 19, 2024
c0f0841
Log state
LPeter1997 Oct 19, 2024
ddb23a1
Update DataFlowAnalysis.cs
LPeter1997 Oct 19, 2024
16ffa91
GenKill tostring util
LPeter1997 Oct 19, 2024
032fe26
Added ranking name
LPeter1997 Oct 19, 2024
c0334d9
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 19, 2024
94b8887
Update ControlFlowGraphToDot.cs
LPeter1997 Oct 19, 2024
017378a
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 19, 2024
70c7126
Update ControlFlowGraphToDot.cs
LPeter1997 Oct 19, 2024
8078d94
Added first snapshot test of CFG
LPeter1997 Oct 20, 2024
cbcd731
Fix, unconditional goto test
LPeter1997 Oct 20, 2024
186813c
Fix, simplification
LPeter1997 Oct 20, 2024
e62cb87
Added while cfg test
LPeter1997 Oct 20, 2024
792163a
Added early return test
LPeter1997 Oct 20, 2024
54de902
Added conditional goto in assignment test
LPeter1997 Oct 20, 2024
afd0d14
Fixed construction
LPeter1997 Oct 20, 2024
80ab3c4
For loop test added
LPeter1997 Oct 20, 2024
8d66929
Relation done
LPeter1997 Oct 20, 2024
01fcdef
Added return path domain
LPeter1997 Oct 20, 2024
73b4977
Added a tuple domain
LPeter1997 Oct 20, 2024
aa9274c
Made domain be based on comparison
LPeter1997 Oct 20, 2024
30b68c6
Update DefiniteAssignmentDomain.cs
LPeter1997 Oct 20, 2024
f9c7fb7
Create CompleteFlowAnalysis.cs
LPeter1997 Oct 20, 2024
bc60ab6
Update CompleteFlowAnalysis.cs
LPeter1997 Oct 20, 2024
fa73d4d
Update CompleteFlowAnalysis.cs
LPeter1997 Oct 20, 2024
f497ed0
Update CompleteFlowAnalysis.cs
LPeter1997 Oct 20, 2024
29e704f
Update CompleteFlowAnalysis.cs
LPeter1997 Oct 20, 2024
7847efb
Update ConstraintSolver.cs
LPeter1997 Oct 20, 2024
ce73e86
Replaced
LPeter1997 Oct 20, 2024
9876503
Update SourceFunctionSymbol.cs
LPeter1997 Oct 20, 2024
0f1d5df
Update CompleteFlowAnalysis.cs
LPeter1997 Oct 20, 2024
a20ad1e
Fixes
LPeter1997 Oct 20, 2024
d7c7371
Update DataFlowAnalysis.cs
LPeter1997 Oct 20, 2024
5856867
Update DefiniteAssignmentDomain.cs
LPeter1997 Oct 20, 2024
d60a928
Update DataFlowAnalysis.cs
LPeter1997 Oct 20, 2024
d5b0940
Update DataFlowAnalysis.cs
LPeter1997 Oct 20, 2024
573240d
Update FlowDomain.cs
LPeter1997 Oct 21, 2024
d5aa376
Update TupleDomain.cs
LPeter1997 Oct 21, 2024
ea45fc7
New domains
LPeter1997 Oct 21, 2024
bca7750
Updated
LPeter1997 Oct 21, 2024
900aa64
Update DefiniteAssignmentDomain.cs
LPeter1997 Oct 21, 2024
fb1ecd7
Update FlowDomain.cs
LPeter1997 Oct 22, 2024
76907a6
Update CompleteFlowAnalysis.cs
LPeter1997 Oct 22, 2024
45283f2
Update CompleteFlowAnalysis.cs
LPeter1997 Oct 22, 2024
e3b6d47
Update BoundTreeCollector.cs
LPeter1997 Oct 22, 2024
e2d302a
Update CompleteFlowAnalysis.cs
LPeter1997 Oct 22, 2024
eb2751c
Create ReturnsOnAllPathsTests.cs
LPeter1997 Oct 22, 2024
9f8e7cd
Update ReturnsOnAllPathsTests.cs
LPeter1997 Oct 22, 2024
7c9f303
More tests
LPeter1997 Oct 22, 2024
3e5b513
Update DefiniteAssignmentTests.cs
LPeter1997 Oct 22, 2024
dff1f96
Update DefiniteAssignmentTests.cs
LPeter1997 Oct 22, 2024
d1210a6
Update DefiniteAssignmentDomain.cs
LPeter1997 Oct 22, 2024
34b3710
Fix
LPeter1997 Oct 22, 2024
8c973d9
Update DefiniteAssignmentDomain.cs
LPeter1997 Oct 22, 2024
e9e37f8
Added single assignment tests
LPeter1997 Oct 23, 2024
5f1d1ed
More tests
LPeter1997 Oct 23, 2024
011f246
Cleanup
LPeter1997 Oct 23, 2024
9ebc381
Update ReturnsOnAllPathsTests.cs
LPeter1997 Oct 23, 2024
98d4afe
Simplified definite assignment back
LPeter1997 Oct 23, 2024
d893355
Cleanup
LPeter1997 Oct 23, 2024
40ec58a
Update ReturnsOnAllPathsTests.cs
LPeter1997 Oct 23, 2024
06b29af
Update ControlFlowGraphBuilder.cs
LPeter1997 Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions src/Draco.Compiler.Tests/Draco.Compiler.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,24 @@
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageReference Include="Verify.Xunit" Version="26.4.5" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<ProjectReference Include="..\Draco.Compiler\Draco.Compiler.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Draco.Compiler\Draco.Compiler.csproj" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageReference Include="Basic.Reference.Assemblies.Net80" Version="1.4.5" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Basic.Reference.Assemblies.Net80" Version="1.4.5" />
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
Expand Down
268 changes: 268 additions & 0 deletions src/Draco.Compiler.Tests/Semantics/ControlFlowGraphTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
using DiffEngine;
using Draco.Compiler.Api.Syntax;
using Draco.Compiler.Internal.FlowAnalysis;
using Draco.Compiler.Internal.Symbols.Source;
using static Draco.Compiler.Api.Syntax.SyntaxFactory;
using static Draco.Compiler.Tests.TestUtilities;

namespace Draco.Compiler.Tests.Semantics;

// Test the building of CFGs itself
public sealed class ControlFlowGraphTests
{
private readonly VerifySettings settings = new();

public ControlFlowGraphTests()
{
DiffTools.UseOrder(DiffTool.VisualStudioCode, DiffTool.VisualStudio, DiffTool.Rider);

this.settings.UseDirectory("ControlFlowGraphs");
}

private static IControlFlowGraph FunctionToCfg(SyntaxTree tree, string? name = null)
{
var functionSyntax = tree.GetNode<FunctionDeclarationSyntax>(predicate: decl => name is null || decl.Name.Text == name);
var compilation = CreateCompilation(tree);
var semanticModel = compilation.GetSemanticModel(tree);
var functionSymbol = GetInternalSymbol<SourceFunctionSymbol>(semanticModel.GetDeclaredSymbol(functionSyntax));
return ControlFlowGraphBuilder.Build(functionSymbol.Body);
}

[Fact]
public async Task EmptyMethod()
{
// Arrange
// func main() {}
var program = SyntaxTree.Create(CompilationUnit(FunctionDeclaration(
"main",
ParameterList(),
null,
BlockFunctionBody())));

// Act
var cfg = FunctionToCfg(program);
var dot = cfg.ToDot();

// Assert
await Verify(dot, this.settings);
}

[Fact]
public async Task UnconditionalBackwardsJump()
{
// Arrange
// func main() {
// loop:
// goto loop;
// }
var program = SyntaxTree.Create(CompilationUnit(FunctionDeclaration(
"main",
ParameterList(),
null,
BlockFunctionBody(
DeclarationStatement(LabelDeclaration("loop")),
ExpressionStatement(GotoExpression(NameLabel("loop")))))));

// Act
var cfg = FunctionToCfg(program);
var dot = cfg.ToDot();

// Assert
await Verify(dot, this.settings);
}

[Fact]
public async Task IfElse()
{
// Arrange
// func foo(b: bool) {
// if (b) bar(); else baz();
// }
// func bar() {}
// func baz() {}
var program = SyntaxTree.Create(CompilationUnit(
FunctionDeclaration(
"main",
ParameterList(Parameter("b", NameType("bool"))),
null,
BlockFunctionBody(
ExpressionStatement(IfExpression(
NameExpression("b"),
CallExpression(NameExpression("bar")),
CallExpression(NameExpression("baz")))))),
FunctionDeclaration("bar", ParameterList(), null, BlockFunctionBody()),
FunctionDeclaration("baz", ParameterList(), null, BlockFunctionBody())));

// Act
var cfg = FunctionToCfg(program);
var dot = cfg.ToDot();

// Assert
await Verify(dot, this.settings);
}

[Fact]
public async Task WhileLoop()
{
// Arrange
// func foo() {
// var i = 0;
// while (i < 10) {
// bar();
// i += 1;
// }
// }
// func bar() {}
var program = SyntaxTree.Create(CompilationUnit(
FunctionDeclaration(
"main",
ParameterList(),
null,
BlockFunctionBody(
DeclarationStatement(VariableDeclaration("i", null, LiteralExpression(0))),
ExpressionStatement(WhileExpression(
RelationalExpression(NameExpression("i"), ComparisonElement(LessThan, LiteralExpression(10))),
BlockExpression(
ExpressionStatement(CallExpression(NameExpression("bar"))),
ExpressionStatement(BinaryExpression(NameExpression("i"), PlusAssign, LiteralExpression(1)))))))),
FunctionDeclaration("bar", ParameterList(), null, BlockFunctionBody())));

// Act
var cfg = FunctionToCfg(program);
var dot = cfg.ToDot();

// Assert
await Verify(dot, this.settings);
}

[Fact]
public async Task EarlyReturn()
{
// Arrange
// func foo(b: bool) {
// bar();
// if (b) return;
// baz();
// }
// func bar() {}
// func baz() {}
var program = SyntaxTree.Create(CompilationUnit(
FunctionDeclaration(
"main",
ParameterList(Parameter("b", NameType("bool"))),
null,
BlockFunctionBody(
ExpressionStatement(CallExpression(NameExpression("bar"))),
ExpressionStatement(IfExpression(
NameExpression("b"),
ReturnExpression())),
ExpressionStatement(CallExpression(NameExpression("baz"))))),
FunctionDeclaration("bar", ParameterList(), null, BlockFunctionBody()),
FunctionDeclaration("baz", ParameterList(), null, BlockFunctionBody())));

// Act
var cfg = FunctionToCfg(program);
var dot = cfg.ToDot();

// Assert
await Verify(dot, this.settings);
}

[Fact]
public async Task ConditionalGotoInAssignment()
{
// Arrange
// func foo(b: bool) {
// val x = if (b) goto noassign else 1;
// noassign:
// bar();
// }
// func bar() {}
var program = SyntaxTree.Create(CompilationUnit(
FunctionDeclaration(
"main",
ParameterList(Parameter("b", NameType("bool"))),
null,
BlockFunctionBody(
DeclarationStatement(VariableDeclaration("x", null, IfExpression(
NameExpression("b"),
GotoExpression(NameLabel("noassign")),
LiteralExpression(1)))),
DeclarationStatement(LabelDeclaration("noassign")),
ExpressionStatement(CallExpression(NameExpression("bar"))))),
FunctionDeclaration("bar", ParameterList(), null, BlockFunctionBody())));

// Act
var cfg = FunctionToCfg(program);
var dot = cfg.ToDot();

// Assert
await Verify(dot, this.settings);
}

[Fact]
public async Task ForLoop()
{
// Arrange
// func foo(s: Array<int32>) {
// for (i in s) bar(i);
// }
// func bar(x: int32) {}
var program = SyntaxTree.Create(CompilationUnit(
FunctionDeclaration(
"main",
ParameterList(Parameter("s", GenericType(NameType("Array"), NameType("int32")))),
null,
BlockFunctionBody(
ExpressionStatement(ForExpression(
"i",
NameExpression("s"),
CallExpression(NameExpression("bar"), NameExpression("i")))))),
FunctionDeclaration("bar", ParameterList(Parameter("x", NameType("int32"))), null, BlockFunctionBody())));

// Act
var cfg = FunctionToCfg(program);
var dot = cfg.ToDot();

// Assert
await Verify(dot, this.settings);
}

[Fact]
public async Task ChainedComparison()
{
// Arrange
// func foo(a: int32, b: int32, c: int32, d: int32): bool =
// { bar(); a } < { baz(); b } == { qux(); c } > { qwe(); d };
//
// func bar() {}
// func baz() {}
// func qux() {}
// func qwe() {}
var program = SyntaxTree.Create(CompilationUnit(
FunctionDeclaration(
"foo",
ParameterList(
Parameter("a", NameType("int32")),
Parameter("b", NameType("int32")),
Parameter("c", NameType("int32")),
Parameter("d", NameType("int32"))),
null,
InlineFunctionBody(RelationalExpression(
BlockExpression([ExpressionStatement(CallExpression(NameExpression("bar")))], NameExpression("a")),
ComparisonElement(LessThan, BlockExpression([ExpressionStatement(CallExpression(NameExpression("baz")))], NameExpression("b"))),
ComparisonElement(Equal, BlockExpression([ExpressionStatement(CallExpression(NameExpression("qux")))], NameExpression("c"))),
ComparisonElement(GreaterThan, BlockExpression([ExpressionStatement(CallExpression(NameExpression("qwe")))], NameExpression("d")))))),
FunctionDeclaration("bar", ParameterList(), null, BlockFunctionBody()),
FunctionDeclaration("baz", ParameterList(), null, BlockFunctionBody()),
FunctionDeclaration("qux", ParameterList(), null, BlockFunctionBody()),
FunctionDeclaration("qwe", ParameterList(), null, BlockFunctionBody())));

// Act
var cfg = FunctionToCfg(program);
var dot = cfg.ToDot();

// Assert
await Verify(dot, this.settings);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
digraph ControlFlowGraph {
0 [shape=rectangle, label=<e0: CallExpression(Method = bar, Arguments = [])<br align="left"/>e1: CallExpression(Method = baz, Arguments = [])<br align="left"/>>, xlabel="b0"];
1 [shape=rectangle, label=<e4: RelationalExpression(First = e5, Comparisons = [Comparison(Operator = op_LessThan, Next = e6), Comparison(Operator = op_Equality, Next = e7), Comparison(Operator = op_GreaterThan, Next = e8)])<br align="left"/>e9: ReturnExpression(Value = e4)<br align="left"/>>, xlabel="b1"];
2 [shape=rectangle, label=<e2: CallExpression(Method = qux, Arguments = [])<br align="left"/>>, xlabel="b2"];
3 [shape=rectangle, label=<e3: CallExpression(Method = qwe, Arguments = [])<br align="left"/>>, xlabel="b3"];
0 -> 1 [label="ComparisonFalse(b, op_Equality(Int32, Int32): Boolean, c)"];
0 -> 2 [label="ComparisonTrue(b, op_Equality(Int32, Int32): Boolean, c)"];
2 -> 1 [label="ComparisonFalse(c, op_GreaterThan(Int32, Int32): Boolean, d)"];
2 -> 3 [label="ComparisonTrue(c, op_GreaterThan(Int32, Int32): Boolean, d)"];
3 -> 1 [label="Always"];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
digraph ControlFlowGraph {
0 [shape=rectangle, label=< >, xlabel="b0"];
1 [shape=rectangle, label=< >, xlabel="b1"];
2 [shape=rectangle, label=< >, xlabel="b2"];
3 [shape=rectangle, label=<e0: AssignmentExpression(Left = x, Right = e1)<br align="left"/>>, xlabel="b4"];
4 [shape=rectangle, label=<e2: CallExpression(Method = bar, Arguments = [])<br align="left"/>e3: ReturnExpression(Value = unit)<br align="left"/>>, xlabel="b3"];
0 -> 1 [label="WhenTrue(b)"];
0 -> 2 [label="WhenFalse(b)"];
2 -> 3 [label="Always"];
3 -> 4 [label="Always"];
1 -> 4 [label="Always"];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
digraph ControlFlowGraph {
0 [shape=rectangle, label=<e0: CallExpression(Method = bar, Arguments = [])<br align="left"/>>, xlabel="b0"];
1 [shape=rectangle, label=<e3: ReturnExpression(Value = unit)<br align="left"/>>, xlabel="b1"];
2 [shape=rectangle, label=< >, xlabel="b2"];
3 [shape=rectangle, label=<e1: CallExpression(Method = baz, Arguments = [])<br align="left"/>e2: ReturnExpression(Value = unit)<br align="left"/>>, xlabel="b4"];
4 [shape=rectangle, label=< >, xlabel="b3"];
0 -> 1 [label="WhenTrue(b)"];
0 -> 2 [label="WhenFalse(b)"];
2 -> 3 [label="Always"];
3 -> 4 [label="Always"];
1 -> 4 [label="Always"];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
digraph ControlFlowGraph {
0 [shape=rectangle, label=<e0: ReturnExpression(Value = unit)<br align="left"/>>, xlabel="b0"];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
digraph ControlFlowGraph {
0 [shape=rectangle, label=< >, xlabel="b0"];
1 [shape=rectangle, label=< >, xlabel="b1"];
2 [shape=rectangle, label=<e0: CallExpression(Method = bar, Arguments = [i])<br align="left"/>>, xlabel="b2"];
3 [shape=rectangle, label=<e1: ReturnExpression(Value = unit)<br align="left"/>>, xlabel="b3"];
0 -> 1 [label="Always"];
1 -> 2 [label="SequenceItem(s)"];
1 -> 3 [label="SequenceEnd(s)"];
2 -> 1 [label="Always"];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
digraph ControlFlowGraph {
0 [shape=rectangle, label=< >, xlabel="b0"];
1 [shape=rectangle, label=<e2: CallExpression(Method = bar, Arguments = [])<br align="left"/>>, xlabel="b1"];
2 [shape=rectangle, label=<e0: CallExpression(Method = baz, Arguments = [])<br align="left"/>>, xlabel="b2"];
3 [shape=rectangle, label=<e1: ReturnExpression(Value = unit)<br align="left"/>>, xlabel="b3"];
0 -> 1 [label="WhenTrue(b)"];
0 -> 2 [label="WhenFalse(b)"];
2 -> 3 [label="Always"];
1 -> 3 [label="Always"];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
digraph ControlFlowGraph {
0 [shape=rectangle, label=< >, xlabel="b0"];
1 [shape=rectangle, label=< >, xlabel="b1"];
0 -> 1 [label="Always"];
1 -> 1 [label="Always"];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
digraph ControlFlowGraph {
0 [shape=rectangle, label=<e0: AssignmentExpression(Left = i, Right = 0)<br align="left"/>>, xlabel="b0"];
1 [shape=rectangle, label=<e1: RelationalExpression(First = i, Comparisons = [Comparison(Operator = op_LessThan, Next = 10)])<br align="left"/>>, xlabel="b1"];
2 [shape=rectangle, label=<e2: CallExpression(Method = bar, Arguments = [])<br align="left"/>e3: AssignmentExpression(CompoundOperator = op_Addition, Left = i, Right = 1)<br align="left"/>>, xlabel="b2"];
3 [shape=rectangle, label=<e4: ReturnExpression(Value = unit)<br align="left"/>>, xlabel="b3"];
0 -> 1 [label="Always"];
1 -> 2 [label="WhenTrue(e1)"];
1 -> 3 [label="WhenFalse(e1)"];
2 -> 1 [label="Always"];
}
Loading
Loading