Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
32cfee50
K
kotlin
项目概览
硅谷海盗
/
kotlin
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kotlin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
32cfee50
编写于
5月 12, 2020
作者:
M
Mikhail Glukhikh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FIR CFG: remove duplicating lambda enter -> exit connection
上级
5ef37148
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
17 addition
and
13 deletion
+17
-13
compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.dot
...ysis-tests/testData/resolve/cfg/flowFromInplaceLambda.dot
+3
-3
compiler/fir/analysis-tests/testData/resolve/cfg/lambdaAsReturnOfLambda.dot
...sis-tests/testData/resolve/cfg/lambdaAsReturnOfLambda.dot
+1
-1
compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot
...ysis-tests/testData/resolve/cfg/lambdaReturningObject.dot
+1
-1
compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot
...sts/testData/resolve/cfg/postponedLambdaInConstructor.dot
+1
-1
compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.dot
...testData/resolve/smartcasts/controlStructures/returns.dot
+1
-1
compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot
...tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot
+1
-1
compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/callsInPlace.dot
.../resolveWithStdlib/contracts/fromLibrary/callsInPlace.dot
+1
-1
compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot
...solveWithStdlib/delegates/delegateWithAnonymousObject.dot
+2
-2
compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts/tryWithLambdaInside.dot
...Data/resolveWithStdlib/smartcasts/tryWithLambdaInside.dot
+1
-1
compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraph.kt
.../jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraph.kt
+4
-0
compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt
...ins/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt
+1
-1
未找到文件。
compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.dot
浏览文件 @
32cfee50
...
...
@@ -310,14 +310,14 @@ digraph flowFromInplaceLambda_kt {
106
[
label
=
"Exit function test_4"
style
=
"filled"
fillcolor
=
red
]
;
}
105
->
{
107
};
107
->
{
108
108
}
[
color
=
green
]
;
107
->
{
108
}
[
color
=
green
]
;
107
->
{
126
}
[
color
=
red
]
;
108
->
{
109
};
109
->
{
110
};
110
->
{
111
};
111
->
{
112
};
112
->
{
113
};
113
->
{
114
114
}
[
color
=
green
]
;
113
->
{
114
}
[
color
=
green
]
;
113
->
{
132
}
[
color
=
red
]
;
114
->
{
115
};
115
->
{
116
};
...
...
@@ -419,7 +419,7 @@ digraph flowFromInplaceLambda_kt {
159
[
label
=
"Exit function test_6"
style
=
"filled"
fillcolor
=
red
]
;
}
158
->
{
160
};
160
->
{
161
161
}
[
color
=
green
]
;
160
->
{
161
}
[
color
=
green
]
;
160
->
{
165
}
[
color
=
red
]
;
161
->
{
162
};
162
->
{
163
};
...
...
compiler/fir/analysis-tests/testData/resolve/cfg/lambdaAsReturnOfLambda.dot
浏览文件 @
32cfee50
...
...
@@ -39,7 +39,7 @@ digraph lambdaAsReturnOfLambda_kt {
11
[
label
=
"Exit property"
style
=
"filled"
fillcolor
=
red
]
;
}
10
->
{
12
};
12
->
{
13
13
}
[
color
=
green
]
;
12
->
{
13
}
[
color
=
green
]
;
12
->
{
0
}
[
color
=
red
]
;
13
->
{
14
};
14
->
{
15
};
...
...
compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot
浏览文件 @
32cfee50
...
...
@@ -72,7 +72,7 @@ digraph lambdaReturningObject_kt {
18
[
label
=
"Exit function foo"
style
=
"filled"
fillcolor
=
red
]
;
}
17
->
{
19
};
19
->
{
20
20
}
[
color
=
green
]
;
19
->
{
20
}
[
color
=
green
]
;
19
->
{
23
}
[
color
=
red
]
;
20
->
{
21
};
21
->
{
22
};
...
...
compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot
浏览文件 @
32cfee50
...
...
@@ -54,7 +54,7 @@ digraph postponedLambdaInConstructor_kt {
13
->
{
15
};
14
->
{
9
}
[
color
=
green
]
;
14
->
{
12
}
[
color
=
red
]
;
15
->
{
16
16
}
[
color
=
green
]
;
15
->
{
16
}
[
color
=
green
]
;
15
->
{
17
}
[
color
=
red
]
;
16
->
{
14
};
17
->
{
19
};
...
...
compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.dot
浏览文件 @
32cfee50
...
...
@@ -477,7 +477,7 @@ digraph returns_kt {
166
->
{
167
};
167
->
{
145
};
168
->
{
169
};
169
->
{
170
170
}
[
color
=
green
]
;
169
->
{
170
}
[
color
=
green
]
;
169
->
{
172
}
[
color
=
red
]
;
170
->
{
171
};
171
->
{
140
};
...
...
compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot
浏览文件 @
32cfee50
...
...
@@ -142,7 +142,7 @@ digraph safeCalls_kt {
47
->
{
44
};
48
->
{
50
};
49
->
{
53
};
50
->
{
51
51
}
[
color
=
green
]
;
50
->
{
51
}
[
color
=
green
]
;
50
->
{
55
}
[
color
=
red
]
;
51
->
{
52
};
52
->
{
49
};
...
...
compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/callsInPlace.dot
浏览文件 @
32cfee50
...
...
@@ -274,7 +274,7 @@ digraph callsInPlace_kt {
93
[
label
=
"Exit function test_8"
style
=
"filled"
fillcolor
=
red
]
;
}
92
->
{
94
};
94
->
{
95
95
}
[
color
=
green
]
;
94
->
{
95
}
[
color
=
green
]
;
94
->
{
97
}
[
color
=
red
]
;
95
->
{
96
};
96
->
{
93
};
...
...
compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot
浏览文件 @
32cfee50
...
...
@@ -163,14 +163,14 @@ digraph delegateWithAnonymousObject_kt {
66
->
{
54
}
[
color
=
green
]
;
54
->
{
56
};
55
->
{
67
}
[
color
=
green
]
;
56
->
{
57
57
}
[
color
=
green
]
;
56
->
{
57
}
[
color
=
green
]
;
57
->
{
58
};
58
->
{
59
};
59
->
{
60
};
60
->
{
61
};
61
->
{
62
};
62
->
{
63
};
63
->
{
64
64
}
[
color
=
green
]
;
63
->
{
64
}
[
color
=
green
]
;
63
->
{
21
}
[
color
=
red
]
;
64
->
{
65
};
65
->
{
55
};
...
...
compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts/tryWithLambdaInside.dot
浏览文件 @
32cfee50
...
...
@@ -155,7 +155,7 @@ finally {
33
->
{
41
};
34
->
{
35
};
35
->
{
36
};
36
->
{
37
37
}
[
color
=
green
]
;
36
->
{
37
}
[
color
=
green
]
;
36
->
{
46
}
[
color
=
red
]
;
37
->
{
38
};
38
->
{
39
};
...
...
compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraph.kt
浏览文件 @
32cfee50
...
...
@@ -68,6 +68,10 @@ sealed class CFGNode<out E : FirElement>(val owner: ControlFlowGraph, val level:
internal
fun
addEdge
(
from
:
CFGNode
<
*
>,
to
:
CFGNode
<
*
>,
kind
:
EdgeKind
,
propagateDeadness
:
Boolean
)
{
from
.
_followingNodes
+=
to
to
.
_previousNodes
+=
from
addJustKindEdge
(
from
,
to
,
kind
,
propagateDeadness
)
}
internal
fun
addJustKindEdge
(
from
:
CFGNode
<
*
>,
to
:
CFGNode
<
*
>,
kind
:
EdgeKind
,
propagateDeadness
:
Boolean
)
{
if
(
kind
!=
EdgeKind
.
Simple
)
{
from
.
_outgoingEdges
[
to
]
=
kind
to
.
_incomingEdges
[
from
]
=
kind
...
...
compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt
浏览文件 @
32cfee50
...
...
@@ -166,7 +166,7 @@ class ControlFlowGraphBuilder {
if
(
postponedExitNode
!=
null
)
{
requireNotNull
(
postponedEnterNode
)
val
kind
=
if
(
postponedEnterNode
.
isDead
)
EdgeKind
.
Dead
else
EdgeKind
.
Cfg
CFGNode
.
addEdge
(
postponedEnterNode
,
postponedExitNode
,
kind
,
propagateDeadness
=
true
)
CFGNode
.
add
JustKind
Edge
(
postponedEnterNode
,
postponedExitNode
,
kind
,
propagateDeadness
=
true
)
}
lexicalScopes
.
pop
()
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录