Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
72dd2ef4
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,发现更多精彩内容 >>
提交
72dd2ef4
编写于
6月 02, 2020
作者:
M
Mikhail Glukhikh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIR] Fix CFG building for secondary constructor with delegation
上级
b4070964
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
45 addition
and
44 deletion
+45
-44
compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.dot
...sts/testData/resolve/problems/secondaryConstructorCfg.dot
+32
-38
compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt
...ins/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt
+13
-6
未找到文件。
compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.dot
浏览文件 @
72dd2ef4
...
...
@@ -17,81 +17,75 @@ digraph secondaryConstructorCfg_kt {
20
[
label
=
"Enter function <init>"
style
=
"filled"
fillcolor
=
red
]
;
22
[
label
=
"Access variable R|<local>/p0|"
]
;
23
[
label
=
"Delegated constructor call: this<R|B|>(...)"
]
;
subgraph
cluster_2
{
color
=
blue
24
[
label
=
"Enter block"
]
;
25
[
label
=
"Access variable R|<local>/p1|"
]
;
26
[
label
=
"Assignment: R|/B.p3|"
]
;
27
[
label
=
"Exit block"
]
;
}
21
[
label
=
"Exit function <init>"
style
=
"filled"
fillcolor
=
red
style
=
"filled"
fillcolor
=
gray
]
;
24
[
label
=
"Access variable R|<local>/p1|"
]
;
25
[
label
=
"Assignment: R|/B.p3|"
]
;
21
[
label
=
"Exit function <init>"
style
=
"filled"
fillcolor
=
red
]
;
}
20
->
{
22
};
22
->
{
23
};
23
->
{
24
};
24
->
{
25
};
25
->
{
26
};
26
->
{
27
};
25
->
{
21
};
subgraph
cluster_
3
{
subgraph
cluster_
2
{
color
=
red
3
7
[
label
=
"Enter class B"
style
=
"filled"
fillcolor
=
red
]
;
subgraph
cluster_
4
{
3
5
[
label
=
"Enter class B"
style
=
"filled"
fillcolor
=
red
]
;
subgraph
cluster_
3
{
color
=
blue
16
[
label
=
"Enter function setter"
style
=
"filled"
fillcolor
=
red
]
;
17
[
label
=
"Exit function setter"
style
=
"filled"
fillcolor
=
red
]
;
}
subgraph
cluster_
5
{
subgraph
cluster_
4
{
color
=
blue
14
[
label
=
"Enter function getter"
style
=
"filled"
fillcolor
=
red
]
;
15
[
label
=
"Exit function getter"
style
=
"filled"
fillcolor
=
red
]
;
}
subgraph
cluster_
6
{
subgraph
cluster_
5
{
color
=
blue
8
[
label
=
"Enter function getter"
style
=
"filled"
fillcolor
=
red
]
;
9
[
label
=
"Exit function getter"
style
=
"filled"
fillcolor
=
red
]
;
}
subgraph
cluster_
7
{
subgraph
cluster_
6
{
color
=
blue
3
[
label
=
"Enter function getter"
style
=
"filled"
fillcolor
=
red
]
;
4
[
label
=
"Exit function getter"
style
=
"filled"
fillcolor
=
red
]
;
}
subgraph
cluster_
8
{
subgraph
cluster_
7
{
color
=
blue
5
[
label
=
"Enter property"
style
=
"filled"
fillcolor
=
red
]
;
7
[
label
=
"Access variable R|<local>/p0|"
]
;
6
[
label
=
"Exit property"
style
=
"filled"
fillcolor
=
red
]
;
}
subgraph
cluster_
9
{
subgraph
cluster_
8
{
color
=
blue
10
[
label
=
"Enter property"
style
=
"filled"
fillcolor
=
red
]
;
12
[
label
=
"Access variable R|<local>/p0|"
]
;
13
[
label
=
"Access variable R|kotlin/String.length|"
]
;
11
[
label
=
"Exit property"
style
=
"filled"
fillcolor
=
red
]
;
}
subgraph
cluster_
10
{
subgraph
cluster_
9
{
color
=
blue
18
[
label
=
"Enter property"
style
=
"filled"
fillcolor
=
red
]
;
19
[
label
=
"Exit property"
style
=
"filled"
fillcolor
=
red
]
;
}
subgraph
cluster_1
1
{
subgraph
cluster_1
0
{
color
=
blue
2
8
[
label
=
"Enter init block"
style
=
"filled"
fillcolor
=
red
]
;
subgraph
cluster_1
2
{
2
6
[
label
=
"Enter init block"
style
=
"filled"
fillcolor
=
red
]
;
subgraph
cluster_1
1
{
color
=
blue
30
[
label
=
"Enter block"
]
;
31
[
label
=
"Access variable R|<local>/p0|"
]
;
3
2
[
label
=
"Access variable R|kotlin/String.length|"
]
;
3
3
[
label
=
"Assignment: R|/B.p1|"
]
;
3
4
[
label
=
"Const: String()"
]
;
3
5
[
label
=
"Assignment: R|/B.p3|"
]
;
3
6
[
label
=
"Exit block"
]
;
28
[
label
=
"Enter block"
]
;
29
[
label
=
"Access variable R|<local>/p0|"
]
;
3
0
[
label
=
"Access variable R|kotlin/String.length|"
]
;
3
1
[
label
=
"Assignment: R|/B.p1|"
]
;
3
2
[
label
=
"Const: String()"
]
;
3
3
[
label
=
"Assignment: R|/B.p3|"
]
;
3
4
[
label
=
"Exit block"
]
;
}
2
9
[
label
=
"Exit init block"
style
=
"filled"
fillcolor
=
red
]
;
2
7
[
label
=
"Exit init block"
style
=
"filled"
fillcolor
=
red
]
;
}
3
8
[
label
=
"Exit class B"
style
=
"filled"
fillcolor
=
red
]
;
3
6
[
label
=
"Exit class B"
style
=
"filled"
fillcolor
=
red
]
;
}
3
7
->
{
5
}
[
color
=
green
]
;
3
5
->
{
5
}
[
color
=
green
]
;
5
->
{
7
};
6
->
{
10
}
[
color
=
green
]
;
7
->
{
6
};
...
...
@@ -102,17 +96,17 @@ digraph secondaryConstructorCfg_kt {
13
->
{
11
};
8
->
{
9
};
18
->
{
19
};
19
->
{
2
8
}
[
color
=
green
]
;
19
->
{
2
6
}
[
color
=
green
]
;
14
->
{
15
};
16
->
{
17
};
28
->
{
30
};
29
->
{
38
}
[
color
=
green
]
;
26
->
{
28
};
27
->
{
36
}
[
color
=
green
]
;
28
->
{
29
};
29
->
{
30
};
30
->
{
31
};
31
->
{
32
};
32
->
{
33
};
33
->
{
34
};
34
->
{
35
};
35
->
{
36
};
36
->
{
29
};
34
->
{
27
};
}
compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt
浏览文件 @
72dd2ef4
...
...
@@ -305,13 +305,20 @@ class ControlFlowGraphBuilder {
// ----------------------------------- Block -----------------------------------
fun
enterBlock
(
block
:
FirBlock
):
BlockEnterNode
?
{
val
lastNode
=
lastNode
return
if
(
lastNode
is
FunctionEnterNode
)
{
when
(
val
lastNode
=
lastNode
)
{
is
FunctionEnterNode
->
{
blocksOfFunctions
[
block
]
=
lastNode
.
fir
null
}
else
{
createBlockEnterNode
(
block
).
also
{
addNewSimpleNode
(
it
)
}.
also
{
levelCounter
++
}
return
null
}
is
DelegatedConstructorCallNode
->
{
val
ownerEnterNode
=
lastNode
.
owner
.
enterNode
if
(
ownerEnterNode
is
FunctionEnterNode
)
{
blocksOfFunctions
[
block
]
=
ownerEnterNode
.
fir
return
null
}
}
}
return
createBlockEnterNode
(
block
).
also
{
addNewSimpleNode
(
it
)
}.
also
{
levelCounter
++
}
}
fun
exitBlock
(
block
:
FirBlock
):
CFGNode
<
*
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录