[FIR] Don't render call arguments in cfg dump
This commit is contained in:
+9
-7
@@ -132,6 +132,8 @@ class FirControlFlowGraphRenderVisitor(
|
||||
}
|
||||
}
|
||||
|
||||
private object CfgRenderMode : FirRenderer.RenderMode(renderLambdaBodies = false, renderCallArguments = false)
|
||||
|
||||
private fun CFGNode<*>.render(): String =
|
||||
buildString {
|
||||
append(
|
||||
@@ -157,26 +159,26 @@ private fun CFGNode<*>.render(): String =
|
||||
is LoopConditionExitNode -> "Exit loop condition"
|
||||
is LoopExitNode -> "Exit ${fir.type()}loop"
|
||||
|
||||
is QualifiedAccessNode -> "Access variable ${fir.calleeReference.render(FirRenderer.RenderMode.DontRenderLambdaBodies)}"
|
||||
is QualifiedAccessNode -> "Access variable ${fir.calleeReference.render(CfgRenderMode)}"
|
||||
is OperatorCallNode -> "Operator ${fir.operation.operator}"
|
||||
is ComparisonExpressionNode -> "Comparison ${fir.operation.operator}"
|
||||
is TypeOperatorCallNode -> "Type operator: \"${fir.render(FirRenderer.RenderMode.DontRenderLambdaBodies)}\""
|
||||
is TypeOperatorCallNode -> "Type operator: \"${fir.render(CfgRenderMode)}\""
|
||||
is JumpNode -> "Jump: ${fir.render()}"
|
||||
is StubNode -> "Stub"
|
||||
is CheckNotNullCallNode -> "Check not null: ${fir.render(FirRenderer.RenderMode.DontRenderLambdaBodies)}"
|
||||
is CheckNotNullCallNode -> "Check not null: ${fir.render(CfgRenderMode)}"
|
||||
|
||||
is ConstExpressionNode -> "Const: ${fir.render()}"
|
||||
is VariableDeclarationNode ->
|
||||
"Variable declaration: ${buildString {
|
||||
FirRenderer(
|
||||
this,
|
||||
FirRenderer.RenderMode.DontRenderLambdaBodies
|
||||
CfgRenderMode
|
||||
).visitCallableDeclaration(fir)
|
||||
}}"
|
||||
|
||||
is VariableAssignmentNode -> "Assignmenet: ${fir.lValue.render(FirRenderer.RenderMode.DontRenderLambdaBodies)}"
|
||||
is FunctionCallNode -> "Function call: ${fir.render(FirRenderer.RenderMode.DontRenderLambdaBodies)}"
|
||||
is ThrowExceptionNode -> "Throw: ${fir.render(FirRenderer.RenderMode.DontRenderLambdaBodies)}"
|
||||
is VariableAssignmentNode -> "Assignmenet: ${fir.lValue.render(CfgRenderMode)}"
|
||||
is FunctionCallNode -> "Function call: ${fir.render(CfgRenderMode)}"
|
||||
is ThrowExceptionNode -> "Throw: ${fir.render(CfgRenderMode)}"
|
||||
|
||||
is TryExpressionEnterNode -> "Try expression enter"
|
||||
is TryMainBlockEnterNode -> "Try main block enter"
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ digraph complex_kt {
|
||||
27 [label="Enter block"];
|
||||
28 [label="Access variable R|<local>/cause|"];
|
||||
29 [label="Access variable R|<local>/closeException|"];
|
||||
30 [label="Function call: R|<local>/cause|.R|/addSuppressed|(R|<local>/closeException|)"];
|
||||
30 [label="Function call: R|<local>/cause|.R|/addSuppressed|(...)"];
|
||||
31 [label="Exit block"];
|
||||
}
|
||||
32 [label="Catch exit"];
|
||||
|
||||
+1
-1
@@ -343,7 +343,7 @@ digraph jumps_kt {
|
||||
117 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
118 [label="Postponed exit from lambda"];
|
||||
119 [label="Function call: R|/run|(<L> = run@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> )"];
|
||||
119 [label="Function call: R|/run|(...)"];
|
||||
120 [label="Exit function test_6" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ digraph lambdaAsReturnOfLambda_kt {
|
||||
color=red
|
||||
4 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
|
||||
5 [label="Access variable R|<local>/foo|"];
|
||||
6 [label="Function call: R|/bar|(R|<local>/foo|)"];
|
||||
6 [label="Function call: R|/bar|(...)"];
|
||||
7 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ digraph lambdaAsReturnOfLambda_kt {
|
||||
10 [label="Enter property" style="filled" fillcolor=red];
|
||||
11 [label="Postponed enter to lambda"];
|
||||
12 [label="Postponed exit from lambda"];
|
||||
13 [label="Function call: R|/run|<R|(kotlin/String) -> kotlin/Unit|>(<L> = run@fun <anonymous>(): R|(kotlin/String) -> kotlin/Unit|)"];
|
||||
13 [label="Function call: R|/run|<R|(kotlin/String) -> kotlin/Unit|>(...)"];
|
||||
14 [label="Exit property" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -40,7 +40,7 @@ digraph lambdas_kt {
|
||||
16 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
17 [label="Postponed exit from lambda"];
|
||||
18 [label="Function call: R|/run|(<L> = run@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> )"];
|
||||
18 [label="Function call: R|/run|(...)"];
|
||||
19 [label="Exit block"];
|
||||
}
|
||||
20 [label="Exit when branch result"];
|
||||
@@ -154,7 +154,7 @@ digraph lambdas_kt {
|
||||
53 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
54 [label="Postponed exit from lambda"];
|
||||
55 [label="Function call: R|/getInt|(<L> = getInt@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> )"];
|
||||
55 [label="Function call: R|/getInt|(...)"];
|
||||
56 [label="Jump: ^test_3 R|/getInt|(<L> = getInt@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> {
|
||||
^test_3 Int(1)
|
||||
}
|
||||
@@ -192,7 +192,7 @@ digraph lambdas_kt {
|
||||
65 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
66 [label="Postponed exit from lambda"];
|
||||
67 [label="Function call: R|/getInt|(block = getInt@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> )"];
|
||||
67 [label="Function call: R|/getInt|(...)"];
|
||||
68 [label="Jump: ^test_4 R|/getInt|(block = getInt@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> {
|
||||
^test_4 Int(1)
|
||||
}
|
||||
|
||||
+2
-2
@@ -104,8 +104,8 @@ digraph loops_kt {
|
||||
32 [label="Enter function testFor" style="filled" fillcolor=red];
|
||||
33 [label="Const: Int(0)"];
|
||||
34 [label="Const: Int(5)"];
|
||||
35 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(Int(5))"];
|
||||
36 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(Int(5)).R|kotlin/ranges/IntProgression.iterator|()"];
|
||||
35 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...)"];
|
||||
36 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...).R|kotlin/ranges/IntProgression.iterator|()"];
|
||||
37 [label="Variable declaration: lval <iterator>: R|kotlin/collections/IntIterator|"];
|
||||
subgraph cluster_11 {
|
||||
color=blue
|
||||
|
||||
@@ -24,7 +24,7 @@ digraph postponedLambdas_kt {
|
||||
}
|
||||
8 [label="Postponed exit from lambda"];
|
||||
9 [label="Access variable R|<local>/b|"];
|
||||
10 [label="Function call: R|/foo|(vararg(R|<local>/a|, foo@fun <anonymous>(): R|kotlin/String| <kind=UNKNOWN> , R|<local>/b|))"];
|
||||
10 [label="Function call: R|/foo|(...)"];
|
||||
11 [label="Exit function test" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ digraph propertiesAndInitBlocks_kt {
|
||||
20 [label="Enter function foo" style="filled" fillcolor=red];
|
||||
21 [label="Const: Int(1)"];
|
||||
22 [label="Const: Int(1)"];
|
||||
23 [label="Function call: Int(1).R|kotlin/Int.plus|(Int(1))"];
|
||||
23 [label="Function call: Int(1).R|kotlin/Int.plus|(...)"];
|
||||
24 [label="Variable declaration: lval c: R|kotlin/Int|"];
|
||||
25 [label="Function call: R|java/lang/Exception.Exception|()"];
|
||||
26 [label="Throw: throw R|java/lang/Exception.Exception|()"];
|
||||
@@ -128,7 +128,7 @@ digraph propertiesAndInitBlocks_kt {
|
||||
41 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
42 [label="Postponed exit from lambda"];
|
||||
43 [label="Function call: R|/run|(<L> = run@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> )"];
|
||||
43 [label="Function call: R|/run|(...)"];
|
||||
44 [label="Exit property" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ digraph returnValuesFromLambda_kt {
|
||||
21 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
22 [label="Postponed exit from lambda"];
|
||||
23 [label="Function call: R|kotlin/run|<R|A|>(<L> = run@fun <anonymous>(): R|A| <kind=EXACTLY_ONCE> )"];
|
||||
23 [label="Function call: R|kotlin/run|<R|A|>(...)"];
|
||||
24 [label="Variable declaration: lval x: R|A|"];
|
||||
25 [label="Exit function test_1" style="filled" fillcolor=red];
|
||||
}
|
||||
@@ -94,7 +94,7 @@ digraph returnValuesFromLambda_kt {
|
||||
32 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
33 [label="Postponed exit from lambda"];
|
||||
34 [label="Function call: R|kotlin/run|<R|C|>(<L> = run@fun <anonymous>(): R|C| <kind=EXACTLY_ONCE> )"];
|
||||
34 [label="Function call: R|kotlin/run|<R|C|>(...)"];
|
||||
35 [label="Variable declaration: lval x: R|C|"];
|
||||
36 [label="Exit function test_2" style="filled" fillcolor=red];
|
||||
}
|
||||
@@ -124,7 +124,7 @@ digraph returnValuesFromLambda_kt {
|
||||
42 [label="Exit function anonymousFunction" style="filled" fillcolor=gray];
|
||||
}
|
||||
43 [label="Postponed exit from lambda"];
|
||||
44 [label="Function call: R|kotlin/run|<R|kotlin/Nothing|>(<L> = run@fun <anonymous>(): R|kotlin/Nothing| <kind=EXACTLY_ONCE> )"];
|
||||
44 [label="Function call: R|kotlin/run|<R|kotlin/Nothing|>(...)"];
|
||||
45 [label="Stub" style="filled" fillcolor=gray];
|
||||
46 [label="Variable declaration: lval x: R|kotlin/Nothing|" style="filled" fillcolor=gray];
|
||||
47 [label="Exit function test_3" style="filled" fillcolor=red];
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ digraph simple_kt {
|
||||
4 [label="Variable declaration: lval x: R|kotlin/Int|"];
|
||||
5 [label="Access variable R|<local>/x|"];
|
||||
6 [label="Const: Int(1)"];
|
||||
7 [label="Function call: R|<local>/x|.R|kotlin/Int.plus|(Int(1))"];
|
||||
7 [label="Function call: R|<local>/x|.R|kotlin/Int.plus|(...)"];
|
||||
8 [label="Variable declaration: lval y: R|kotlin/Int|"];
|
||||
9 [label="Function call: R|/foo|()"];
|
||||
10 [label="Exit function test" style="filled" fillcolor=red];
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ digraph when_kt {
|
||||
7 [label="Enter when branch condition "];
|
||||
8 [label="Access variable R|<local>/x|"];
|
||||
9 [label="Const: Int(2)"];
|
||||
10 [label="Function call: R|<local>/x|.R|kotlin/Int.rem|(Int(2))"];
|
||||
10 [label="Function call: R|<local>/x|.R|kotlin/Int.rem|(...)"];
|
||||
11 [label="Const: Int(0)"];
|
||||
12 [label="Operator =="];
|
||||
13 [label="Exit when branch condition"];
|
||||
@@ -32,7 +32,7 @@ digraph when_kt {
|
||||
14 [label="Enter when branch condition "];
|
||||
15 [label="Const: Int(1)"];
|
||||
16 [label="Const: Int(1)"];
|
||||
17 [label="Function call: Int(1).R|kotlin/Int.minus|(Int(1))"];
|
||||
17 [label="Function call: Int(1).R|kotlin/Int.minus|(...)"];
|
||||
18 [label="Const: Int(0)"];
|
||||
19 [label="Operator =="];
|
||||
20 [label="Exit when branch condition"];
|
||||
|
||||
@@ -87,7 +87,7 @@ digraph exhaustiveWhenAndDNNType_kt {
|
||||
}
|
||||
35 [label="Variable declaration: lval b: R|B|"];
|
||||
36 [label="Access variable R|<local>/b|"];
|
||||
37 [label="Function call: R|/takeB|(R|<local>/b|)"];
|
||||
37 [label="Function call: R|/takeB|(...)"];
|
||||
38 [label="Exit function test_1" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ digraph exhaustiveWhenAndDNNType_kt {
|
||||
}
|
||||
64 [label="Variable declaration: lval b: R|B|"];
|
||||
65 [label="Access variable R|<local>/b|"];
|
||||
66 [label="Function call: R|/takeB|(R|<local>/b|)"];
|
||||
66 [label="Function call: R|/takeB|(...)"];
|
||||
67 [label="Exit function test_2" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ digraph exhaustiveWhenAndDNNType_kt {
|
||||
}
|
||||
92 [label="Variable declaration: lval b: R|B|"];
|
||||
93 [label="Access variable R|<local>/b|"];
|
||||
94 [label="Function call: R|/takeB|(R|<local>/b|)"];
|
||||
94 [label="Function call: R|/takeB|(...)"];
|
||||
95 [label="Exit function test_3" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -427,7 +427,7 @@ digraph returns_kt {
|
||||
161 [label="Variable declaration: lval length: R|kotlin/Int|"];
|
||||
162 [label="Postponed enter to lambda"];
|
||||
163 [label="Postponed exit from lambda"];
|
||||
164 [label="Function call: R|/runHigherOrder|<R|kotlin/Int|>(<L> = runHigherOrder@fun <anonymous>(): R|kotlin/Int|)"];
|
||||
164 [label="Function call: R|/runHigherOrder|<R|kotlin/Int|>(...)"];
|
||||
165 [label="Exit function test_4" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-9
@@ -72,15 +72,7 @@ digraph smartcastFromArgument_kt {
|
||||
30 [label="Exit when branch result" style="filled" fillcolor=gray];
|
||||
31 [label="Exit when"];
|
||||
}
|
||||
32 [label="Function call: R|/takeA|(when (lval <elvis>: R|A?| = (R|<local>/a| as? R|A|)) {
|
||||
==($subj$, Null(null)) -> {
|
||||
^test Unit
|
||||
}
|
||||
else -> {
|
||||
R|<local>/<elvis>|
|
||||
}
|
||||
}
|
||||
)"];
|
||||
32 [label="Function call: R|/takeA|(...)"];
|
||||
33 [label="Exit when branch condition"];
|
||||
}
|
||||
34 [label="Synthetic else branch"];
|
||||
|
||||
+3
-3
@@ -56,7 +56,7 @@ digraph inPlaceLambdas_kt {
|
||||
20 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
21 [label="Postponed exit from lambda"];
|
||||
22 [label="Function call: R|/run|(<L> = run@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> )"];
|
||||
22 [label="Function call: R|/run|(...)"];
|
||||
23 [label="Exit block"];
|
||||
}
|
||||
24 [label="Exit when branch result"];
|
||||
@@ -99,7 +99,7 @@ digraph inPlaceLambdas_kt {
|
||||
32 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
33 [label="Postponed exit from lambda"];
|
||||
34 [label="Function call: R|/run|(<L> = run@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> )"];
|
||||
34 [label="Function call: R|/run|(...)"];
|
||||
35 [label="Access variable R|<local>/x|"];
|
||||
36 [label="Function call: R|<local>/x|.R|/B.bar|()"];
|
||||
37 [label="Exit function test_2" style="filled" fillcolor=red];
|
||||
@@ -147,7 +147,7 @@ digraph inPlaceLambdas_kt {
|
||||
53 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
54 [label="Postponed exit from lambda"];
|
||||
55 [label="Function call: R|/run|(<L> = run@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> )"];
|
||||
55 [label="Function call: R|/run|(...)"];
|
||||
56 [label="Access variable R|<local>/x|"];
|
||||
57 [label="Function call: R|<local>/x|.R|/B.bar|()"];
|
||||
58 [label="Exit block"];
|
||||
|
||||
+3
-3
@@ -215,18 +215,18 @@ digraph implicitReceivers_kt {
|
||||
79 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
80 [label="Postponed exit from lambda"];
|
||||
81 [label="Function call: R|kotlin/with|<R|kotlin/Any|, R|kotlin/Unit|>(R|<local>/c|, <L> = wc@fun R|kotlin/Any|.<anonymous>(): R|kotlin/Unit| <kind=EXACTLY_ONCE> )"];
|
||||
81 [label="Function call: R|kotlin/with|<R|kotlin/Any|, R|kotlin/Unit|>(...)"];
|
||||
82 [label="Access variable this@R|special/anonymous|"];
|
||||
83 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"];
|
||||
84 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"];
|
||||
85 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
86 [label="Postponed exit from lambda"];
|
||||
87 [label="Function call: R|kotlin/with|<R|kotlin/Any|, R|kotlin/Unit|>(R|<local>/b|, <L> = wb@fun R|kotlin/Any|.<anonymous>(): R|kotlin/Unit| <kind=EXACTLY_ONCE> )"];
|
||||
87 [label="Function call: R|kotlin/with|<R|kotlin/Any|, R|kotlin/Unit|>(...)"];
|
||||
88 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
89 [label="Postponed exit from lambda"];
|
||||
90 [label="Function call: R|kotlin/with|<R|kotlin/Any|, R|kotlin/Unit|>(R|<local>/a|, <L> = wa@fun R|kotlin/Any|.<anonymous>(): R|kotlin/Unit| <kind=EXACTLY_ONCE> )"];
|
||||
90 [label="Function call: R|kotlin/with|<R|kotlin/Any|, R|kotlin/Unit|>(...)"];
|
||||
91 [label="Exit function test_3" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ digraph safeCalls_kt {
|
||||
11 [label="Access variable R|kotlin/String.length|"];
|
||||
12 [label="Const: Int(1)"];
|
||||
13 [label="Operator =="];
|
||||
14 [label="Function call: R|<local>/x|?.R|/foo|(==(R|<local>/x|.R|kotlin/String.length|, Int(1)))"];
|
||||
14 [label="Function call: R|<local>/x|?.R|/foo|(...)"];
|
||||
15 [label="Exit safe call"];
|
||||
16 [label="Access variable R|<local>/x|"];
|
||||
17 [label="Access variable <Inapplicable(WRONG_RECEIVER): [kotlin/String.length]>#"];
|
||||
@@ -85,7 +85,7 @@ digraph safeCalls_kt {
|
||||
27 [label="Type operator: (R|<local>/x| as? R|A|)"];
|
||||
28 [label="Enter safe call"];
|
||||
29 [label="Access variable R|<local>/x|"];
|
||||
30 [label="Function call: (R|<local>/x| as? R|A|)?.R|/A.bar|(R|<local>/x|)"];
|
||||
30 [label="Function call: (R|<local>/x| as? R|A|)?.R|/A.bar|(...)"];
|
||||
31 [label="Exit safe call"];
|
||||
32 [label="Exit function test_2" style="filled" fillcolor=red];
|
||||
}
|
||||
@@ -105,17 +105,17 @@ digraph safeCalls_kt {
|
||||
35 [label="Type operator: (R|<local>/x| as? R|A|)"];
|
||||
36 [label="Enter safe call"];
|
||||
37 [label="Access variable R|<local>/x|"];
|
||||
38 [label="Function call: (R|<local>/x| as? R|A|)?.R|/A.bar|(R|<local>/x|)"];
|
||||
38 [label="Function call: (R|<local>/x| as? R|A|)?.R|/A.bar|(...)"];
|
||||
39 [label="Exit safe call"];
|
||||
40 [label="Enter safe call"];
|
||||
41 [label="Access variable R|<local>/x|"];
|
||||
42 [label="Function call: R|<local>/x|.R|/A.bool|()"];
|
||||
43 [label="Function call: (R|<local>/x| as? R|A|)?.R|/A.bar|(R|<local>/x|)?.R|/foo|(R|<local>/x|.R|/A.bool|())"];
|
||||
43 [label="Function call: (R|<local>/x| as? R|A|)?.R|/A.bar|(...)?.R|/foo|(...)"];
|
||||
44 [label="Exit safe call"];
|
||||
45 [label="Enter safe call"];
|
||||
46 [label="Postponed enter to lambda"];
|
||||
47 [label="Postponed exit from lambda"];
|
||||
48 [label="Function call: (R|<local>/x| as? R|A|)?.R|/A.bar|(R|<local>/x|)?.R|/foo|(R|<local>/x|.R|/A.bool|())?.R|/let|(<L> = let@fun <anonymous>(): R|kotlin/Unit|)"];
|
||||
48 [label="Function call: (R|<local>/x| as? R|A|)?.R|/A.bar|(...)?.R|/foo|(...)?.R|/let|(...)"];
|
||||
49 [label="Exit safe call"];
|
||||
50 [label="Access variable R|<local>/x|"];
|
||||
51 [label="Function call: R|<local>/x|.<Unresolved name: bool>#()"];
|
||||
@@ -202,12 +202,12 @@ digraph safeCalls_kt {
|
||||
77 [label="Exit function anonymousFunction" style="filled" fillcolor=gray];
|
||||
}
|
||||
78 [label="Postponed exit from lambda"];
|
||||
79 [label="Function call: R|<local>/x|?.R|kotlin/let|<R|A|, R|kotlin/Nothing|>(<L> = let@fun <anonymous>(it: R|A|): R|kotlin/Nothing| <kind=EXACTLY_ONCE> )"];
|
||||
79 [label="Function call: R|<local>/x|?.R|kotlin/let|<R|A|, R|kotlin/Nothing|>(...)"];
|
||||
80 [label="Exit safe call"];
|
||||
81 [label="Enter safe call"];
|
||||
82 [label="Access variable R|<local>/x|"];
|
||||
83 [label="Function call: R|<local>/x|.R|/A.bool|()"];
|
||||
84 [label="Function call: R|<local>/x|?.R|kotlin/let|<R|A|, R|kotlin/Nothing|>(<L> = let@fun <anonymous>(it: R|A|): R|kotlin/Nothing| <kind=EXACTLY_ONCE> )?.R|/boo|(R|<local>/x|.R|/A.bool|())"];
|
||||
84 [label="Function call: R|<local>/x|?.R|kotlin/let|<R|A|, R|kotlin/Nothing|>(...)?.R|/boo|(...)"];
|
||||
85 [label="Exit safe call"];
|
||||
86 [label="Access variable R|<local>/x|"];
|
||||
87 [label="Function call: R|<local>/x|.<Inapplicable(WRONG_RECEIVER): [/A.id]>#()"];
|
||||
|
||||
@@ -215,7 +215,7 @@ digraph smartcastToNothing_kt {
|
||||
87 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
88 [label="Postponed exit from lambda"];
|
||||
89 [label="Function call: R|<local>/s|?.R|kotlin/let|<R|A|, R|kotlin/Int|>(<L> = let@fun <anonymous>(it: R|A|): R|kotlin/Int| <kind=EXACTLY_ONCE> )"];
|
||||
89 [label="Function call: R|<local>/s|?.R|kotlin/let|<R|A|, R|kotlin/Int|>(...)"];
|
||||
90 [label="Exit safe call"];
|
||||
91 [label="Exit function test_0" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
+10
-10
@@ -16,7 +16,7 @@ digraph callsInPlace_kt {
|
||||
6 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
7 [label="Postponed exit from lambda"];
|
||||
8 [label="Function call: R|kotlin/run|<R|kotlin/Unit|>(<L> = run@fun <anonymous>(): R|kotlin/Unit| <kind=EXACTLY_ONCE> )"];
|
||||
8 [label="Function call: R|kotlin/run|<R|kotlin/Unit|>(...)"];
|
||||
9 [label="Access variable R|<local>/x|"];
|
||||
10 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
|
||||
11 [label="Exit function test" style="filled" fillcolor=red];
|
||||
@@ -47,7 +47,7 @@ digraph callsInPlace_kt {
|
||||
17 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
18 [label="Postponed exit from lambda"];
|
||||
19 [label="Function call: R|kotlin/repeat|(Int(10), <L> = repeat@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Unit| <kind=UNKNOWN> )"];
|
||||
19 [label="Function call: R|kotlin/repeat|(...)"];
|
||||
20 [label="Exit function test_2" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ digraph callsInPlace_kt {
|
||||
}
|
||||
26 [label="Postponed exit from lambda"];
|
||||
27 [label="Const: Int(10)"];
|
||||
28 [label="Function call: R|kotlin/repeat|(action = repeat@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Unit| <kind=UNKNOWN> , times = Int(10))"];
|
||||
28 [label="Function call: R|kotlin/repeat|(...)"];
|
||||
29 [label="Exit function test_3" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
@@ -100,12 +100,12 @@ digraph callsInPlace_kt {
|
||||
34 [label="Const: String(test_4)"];
|
||||
35 [label="Access variable R|<local>/it|"];
|
||||
36 [label="Const: Int(0)"];
|
||||
37 [label="Function call: R|<local>/it|.R|kotlin/Int.compareTo|(Int(0))"];
|
||||
37 [label="Function call: R|<local>/it|.R|kotlin/Int.compareTo|(...)"];
|
||||
38 [label="Comparison >"];
|
||||
39 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
40 [label="Postponed exit from lambda"];
|
||||
41 [label="Function call: Int(1).R|kotlin/takeUnless|<R|kotlin/Int|>(<L> = takeUnless@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Boolean| <kind=EXACTLY_ONCE> )"];
|
||||
41 [label="Function call: Int(1).R|kotlin/takeUnless|<R|kotlin/Int|>(...)"];
|
||||
42 [label="Exit function test_4" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
@@ -134,12 +134,12 @@ digraph callsInPlace_kt {
|
||||
47 [label="Const: String(test_5)"];
|
||||
48 [label="Access variable R|<local>/it|"];
|
||||
49 [label="Const: Int(0)"];
|
||||
50 [label="Function call: R|<local>/it|.R|kotlin/Int.compareTo|(Int(0))"];
|
||||
50 [label="Function call: R|<local>/it|.R|kotlin/Int.compareTo|(...)"];
|
||||
51 [label="Comparison >"];
|
||||
52 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
53 [label="Postponed exit from lambda"];
|
||||
54 [label="Function call: Int(1).R|kotlin/takeUnless|<R|kotlin/Int|>(predicate = takeUnless@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Boolean| <kind=EXACTLY_ONCE> )"];
|
||||
54 [label="Function call: Int(1).R|kotlin/takeUnless|<R|kotlin/Int|>(...)"];
|
||||
55 [label="Exit function test_5" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ digraph callsInPlace_kt {
|
||||
69 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
70 [label="Postponed exit from lambda"];
|
||||
71 [label="Function call: R|/myRun|(myRun@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> , <L> = myRun@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> )"];
|
||||
71 [label="Function call: R|/myRun|(...)"];
|
||||
72 [label="Exit function test_6" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ digraph callsInPlace_kt {
|
||||
82 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
83 [label="Postponed exit from lambda"];
|
||||
84 [label="Function call: R|/myRun|(block2 = myRun@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> , block1 = myRun@fun <anonymous>(): R|kotlin/Unit| <kind=UNKNOWN> )"];
|
||||
84 [label="Function call: R|/myRun|(...)"];
|
||||
85 [label="Exit function test_7" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ digraph callsInPlace_kt {
|
||||
89 [label="Enter function test_8" style="filled" fillcolor=red];
|
||||
90 [label="Postponed enter to lambda"];
|
||||
91 [label="Postponed exit from lambda"];
|
||||
92 [label="Function call: R|/myDummyRun|(<L> = myDummyRun@fun <anonymous>(): R|kotlin/Unit|)"];
|
||||
92 [label="Function call: R|/myDummyRun|(...)"];
|
||||
93 [label="Exit function test_8" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -8,7 +8,7 @@ digraph conditionalEffects_kt {
|
||||
0 [label="Enter function test_1" style="filled" fillcolor=red];
|
||||
1 [label="Access variable R|<local>/x|"];
|
||||
2 [label="Type operator: (R|<local>/x| is R|kotlin/Int|)"];
|
||||
3 [label="Function call: R|kotlin/require|((R|<local>/x| is R|kotlin/Int|))"];
|
||||
3 [label="Function call: R|kotlin/require|(...)"];
|
||||
subgraph cluster_1 {
|
||||
color=blue
|
||||
4 [label="Enter contract"];
|
||||
@@ -36,7 +36,7 @@ digraph conditionalEffects_kt {
|
||||
color=red
|
||||
11 [label="Enter function test_2" style="filled" fillcolor=red];
|
||||
12 [label="Access variable R|<local>/x|"];
|
||||
13 [label="Function call: R|kotlin/requireNotNull|<R|kotlin/String|>(R|<local>/x|)"];
|
||||
13 [label="Function call: R|kotlin/requireNotNull|<R|kotlin/String|>(...)"];
|
||||
subgraph cluster_3 {
|
||||
color=blue
|
||||
14 [label="Enter contract"];
|
||||
@@ -67,7 +67,7 @@ digraph conditionalEffects_kt {
|
||||
23 [label="Access variable R|<local>/x|"];
|
||||
24 [label="Const: Null(null)"];
|
||||
25 [label="Operator !="];
|
||||
26 [label="Function call: R|kotlin/require|(!=(R|<local>/x|, Null(null)))"];
|
||||
26 [label="Function call: R|kotlin/require|(...)"];
|
||||
subgraph cluster_5 {
|
||||
color=blue
|
||||
27 [label="Enter contract"];
|
||||
@@ -109,7 +109,7 @@ digraph conditionalEffects_kt {
|
||||
43 [label="Operator !="];
|
||||
44 [label="Exit &&"];
|
||||
}
|
||||
45 [label="Function call: R|kotlin/require|((R|<local>/x| is R|kotlin/String|) && !=(R|<local>/y|, Null(null)))"];
|
||||
45 [label="Function call: R|kotlin/require|(...)"];
|
||||
subgraph cluster_8 {
|
||||
color=blue
|
||||
46 [label="Enter contract"];
|
||||
@@ -193,7 +193,7 @@ digraph conditionalEffects_kt {
|
||||
76 [label="Enter block"];
|
||||
77 [label="Access variable R|<local>/x|"];
|
||||
78 [label="Type operator: (R|<local>/x| is R|kotlin/String|)"];
|
||||
79 [label="Function call: R|kotlin/require|((R|<local>/x| is R|kotlin/String|))"];
|
||||
79 [label="Function call: R|kotlin/require|(...)"];
|
||||
subgraph cluster_16 {
|
||||
color=blue
|
||||
80 [label="Enter contract"];
|
||||
@@ -266,7 +266,7 @@ digraph conditionalEffects_kt {
|
||||
100 [label="Enter block"];
|
||||
101 [label="Access variable R|<local>/x|"];
|
||||
102 [label="Type operator: (R|<local>/x| is R|kotlin/String|)"];
|
||||
103 [label="Function call: R|kotlin/require|((R|<local>/x| is R|kotlin/String|))"];
|
||||
103 [label="Function call: R|kotlin/require|(...)"];
|
||||
subgraph cluster_22 {
|
||||
color=blue
|
||||
104 [label="Enter contract"];
|
||||
@@ -285,7 +285,7 @@ digraph conditionalEffects_kt {
|
||||
113 [label="Enter block"];
|
||||
114 [label="Access variable R|<local>/x|"];
|
||||
115 [label="Type operator: (R|<local>/x| is R|kotlin/String|)"];
|
||||
116 [label="Function call: R|kotlin/require|((R|<local>/x| is R|kotlin/String|))"];
|
||||
116 [label="Function call: R|kotlin/require|(...)"];
|
||||
subgraph cluster_24 {
|
||||
color=blue
|
||||
117 [label="Enter contract"];
|
||||
|
||||
+6
-6
@@ -90,7 +90,7 @@ digraph delegateWithAnonymousObject_kt {
|
||||
24 [label="Enter function setValue" style="filled" fillcolor=red];
|
||||
25 [label="Function call: R|/IssueListView.IssueListView|()"];
|
||||
26 [label="Access variable R|<local>/value|"];
|
||||
27 [label="Function call: R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(R|<local>/value|)"];
|
||||
27 [label="Function call: R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(...)"];
|
||||
28 [label="Jump: ^setValue R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(R|<local>/value|)"];
|
||||
29 [label="Stub" style="filled" fillcolor=gray];
|
||||
30 [label="Exit function setValue" style="filled" fillcolor=red];
|
||||
@@ -109,7 +109,7 @@ digraph delegateWithAnonymousObject_kt {
|
||||
31 [label="Enter function getter" style="filled" fillcolor=red];
|
||||
32 [label="Access variable D|/IssuesListUserProfile.issueListView|"];
|
||||
33 [label="Access variable this@R|/IssuesListUserProfile|"];
|
||||
34 [label="Function call: D|/IssuesListUserProfile.issueListView|.R|FakeOverride<kotlin/properties/ReadWriteProperty.getValue: R|IssueListView|>|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"];
|
||||
34 [label="Function call: D|/IssuesListUserProfile.issueListView|.R|FakeOverride<kotlin/properties/ReadWriteProperty.getValue: R|IssueListView|>|(...)"];
|
||||
35 [label="Jump: ^ D|/IssuesListUserProfile.issueListView|.R|FakeOverride<kotlin/properties/ReadWriteProperty.getValue: R|IssueListView|>|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"];
|
||||
36 [label="Stub" style="filled" fillcolor=gray];
|
||||
37 [label="Exit function getter" style="filled" fillcolor=red];
|
||||
@@ -129,7 +129,7 @@ digraph delegateWithAnonymousObject_kt {
|
||||
39 [label="Access variable D|/IssuesListUserProfile.issueListView|"];
|
||||
40 [label="Access variable this@R|/IssuesListUserProfile|"];
|
||||
41 [label="Access variable R|<local>/issueListView|"];
|
||||
42 [label="Function call: D|/IssuesListUserProfile.issueListView|.R|FakeOverride<kotlin/properties/ReadWriteProperty.setValue: R|kotlin/Unit|>|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|, R|<local>/issueListView|)"];
|
||||
42 [label="Function call: D|/IssuesListUserProfile.issueListView|.R|FakeOverride<kotlin/properties/ReadWriteProperty.setValue: R|kotlin/Unit|>|(...)"];
|
||||
43 [label="Exit function setter" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
@@ -144,14 +144,14 @@ digraph delegateWithAnonymousObject_kt {
|
||||
44 [label="Enter property" style="filled" fillcolor=red];
|
||||
45 [label="Postponed enter to lambda"];
|
||||
46 [label="Postponed exit from lambda"];
|
||||
47 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|<R|IssuesListUserProfile|, R|IssuesListUserProfile|, R|IssueListView|>(<L> = delegate@fun <anonymous>(): R|kotlin/properties/ReadWriteProperty<IssuesListUserProfile, IssueListView>|)"];
|
||||
47 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|<R|IssuesListUserProfile|, R|IssuesListUserProfile|, R|IssueListView|>(...)"];
|
||||
48 [label="Access variable this@R|/IssuesListUserProfile|"];
|
||||
49 [label="Access variable this@R|/IssuesListUserProfile|"];
|
||||
50 [label="Access variable this@R|/IssuesListUserProfile|"];
|
||||
51 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|<R|IssuesListUserProfile|, R|IssuesListUserProfile|, R|IssueListView|>(<L> = delegate@fun <anonymous>(): R|kotlin/properties/ReadWriteProperty<IssuesListUserProfile, IssueListView>|).<Unresolved name: provideDelegate>#(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"];
|
||||
51 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|<R|IssuesListUserProfile|, R|IssuesListUserProfile|, R|IssueListView|>(...).<Unresolved name: provideDelegate>#(...)"];
|
||||
52 [label="Postponed enter to lambda"];
|
||||
53 [label="Postponed exit from lambda"];
|
||||
54 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|<R|IssuesListUserProfile|, R|IssuesListUserProfile|, R|IssueListView|>(<L> = delegate@fun <anonymous>(): R|kotlin/properties/ReadWriteProperty<IssuesListUserProfile, IssueListView>|)"];
|
||||
54 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|<R|IssuesListUserProfile|, R|IssuesListUserProfile|, R|IssueListView|>(...)"];
|
||||
55 [label="Exit property" style="filled" fillcolor=red];
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -47,7 +47,7 @@ digraph tryWithLambdaInside_kt {
|
||||
15 [label="Exit function anonymousFunction"];
|
||||
}
|
||||
16 [label="Postponed exit from lambda"];
|
||||
17 [label="Function call: R|<local>/list|.R|kotlin/collections/filter|<R|kotlin/Boolean|>(<L> = filter@fun <anonymous>(it: R|kotlin/Boolean|): R|kotlin/Boolean| <kind=UNKNOWN> )"];
|
||||
17 [label="Function call: R|<local>/list|.R|kotlin/collections/filter|<R|kotlin/Boolean|>(...)"];
|
||||
18 [label="Exit block"];
|
||||
}
|
||||
19 [label="Try main block exit"];
|
||||
@@ -116,7 +116,7 @@ finally {
|
||||
32 [label="Access variable R|<local>/list|"];
|
||||
33 [label="Postponed enter to lambda"];
|
||||
34 [label="Postponed exit from lambda"];
|
||||
35 [label="Function call: R|<local>/list|.R|/notInPlaceFilter|<R|kotlin/Boolean|>(<L> = notInPlaceFilter@fun <anonymous>(it: R|kotlin/Boolean|): R|kotlin/Boolean|)"];
|
||||
35 [label="Function call: R|<local>/list|.R|/notInPlaceFilter|<R|kotlin/Boolean|>(...)"];
|
||||
36 [label="Exit block"];
|
||||
}
|
||||
37 [label="Try main block exit"];
|
||||
|
||||
@@ -42,8 +42,8 @@ fun FirElement.render(mode: FirRenderer.RenderMode = FirRenderer.RenderMode.Norm
|
||||
buildString { this@render.accept(FirRenderer(this, mode)) }
|
||||
|
||||
class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderMode.Normal) : FirVisitorVoid() {
|
||||
enum class RenderMode {
|
||||
Normal, DontRenderLambdaBodies
|
||||
abstract class RenderMode(val renderLambdaBodies: Boolean, val renderCallArguments: Boolean) {
|
||||
object Normal : RenderMode(renderLambdaBodies = true, renderCallArguments = true)
|
||||
}
|
||||
|
||||
private val printer = Printer(builder)
|
||||
@@ -427,7 +427,7 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM
|
||||
if (anonymousFunction.invocationKind != null) {
|
||||
print(" <kind=${anonymousFunction.invocationKind}> ")
|
||||
}
|
||||
if (mode != RenderMode.DontRenderLambdaBodies) {
|
||||
if (mode.renderLambdaBodies) {
|
||||
anonymousFunction.body?.renderBody()
|
||||
}
|
||||
}
|
||||
@@ -677,7 +677,13 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM
|
||||
|
||||
override fun visitCall(call: FirCall) {
|
||||
print("(")
|
||||
call.arguments.renderSeparated()
|
||||
if (mode.renderCallArguments) {
|
||||
call.arguments.renderSeparated()
|
||||
} else {
|
||||
if (call.arguments.isNotEmpty()) {
|
||||
print("...")
|
||||
}
|
||||
}
|
||||
print(")")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user