Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
4df0e4fd
F
fsharp
项目概览
dotNET Platform
/
fsharp
11 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4df0e4fd
编写于
10月 28, 2019
作者:
T
TIHan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix regression test, starting to add linear match expr handling
上级
0a6764ab
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
16 deletion
+19
-16
src/fsharp/IlxGen.fs
src/fsharp/IlxGen.fs
+19
-16
未找到文件。
src/fsharp/IlxGen.fs
浏览文件 @
4df0e4fd
...
...
@@ -1913,8 +1913,7 @@ let CodeGenThen cenv mgbuf (entryPointInfo, methodName, eenv, alreadyUsedArgs, c
(* Call the given code generator *)
codeGenFunction
cgbuf
{
eenv
with
withinSEH
=
false
liveLocals
=
IntMap
.
empty
()
innerVals
=
innerVals
inLoop
=
false
}
innerVals
=
innerVals
}
let
locals
,
maxStack
,
lab2pc
,
code
,
exnSpecs
,
hasSequencePoints
=
cgbuf
.
Close
()
...
...
@@ -2212,6 +2211,15 @@ and GenExprAux (cenv: cenv) (cgbuf: CodeGenBuffer) eenv sp expr sequel =
|
None
->
match
expr
with
// Most generation of linear expressions is implemented routinely using tailcalls and the correct sequels.
// This is because the element of expansion happens to be the final thing generated in most cases. However
// for large lists we have to process the linearity separately
|
Expr
.
Sequential
_
|
Expr
.
Let
_
|
LinearOpExpr
_
|
LinearMatchExpr
_
->
GenLinearExpr
cenv
cgbuf
eenv
sp
expr
sequel
(* canProcessSequencePoint *)
false
id
|>
ignore
<
FakeUnit
>
|
Expr
.
Const
(
c
,
m
,
ty
)
->
GenConstant
cenv
cgbuf
eenv
(
c
,
m
,
ty
)
sequel
|
Expr
.
Match
(
spBind
,
exprm
,
tree
,
targets
,
m
,
ty
)
->
...
...
@@ -2235,14 +2243,6 @@ and GenExprAux (cenv: cenv) (cgbuf: CodeGenBuffer) eenv sp expr sequel =
|
Expr
.
Val
(
v
,
_,
m
)
->
GenGetVal
cenv
cgbuf
eenv
(
v
,
m
)
sequel
// Most generation of linear expressions is implemented routinely using tailcalls and the correct sequels.
// This is because the element of expansion happens to be the final thing generated in most cases. However
// for large lists we have to process the linearity separately
|
Expr
.
Sequential
_
|
Expr
.
Let
_
|
LinearOpExpr
_
->
GenLinearExpr
cenv
cgbuf
eenv
sp
expr
sequel
(* canProcessSequencePoint *)
false
id
|>
ignore
<
FakeUnit
>
|
Expr
.
Op
(
op
,
tyargs
,
args
,
m
)
->
match
op
,
args
,
tyargs
with
|
TOp
.
ExnConstr
c
,
_,
_
->
...
...
@@ -2555,6 +2555,10 @@ and GenAllocUnionCase cenv cgbuf eenv (c,tyargs,args,m) sequel =
and
GenLinearExpr
cenv
cgbuf
eenv
sp
expr
sequel
canProcessSequencePoint
(
contf
:
FakeUnit
->
FakeUnit
)
=
let
expr
=
stripExpr
expr
if
canProcessSequencePoint
then
ProcessSequencePointForExpr
cenv
cgbuf
sp
expr
match
expr
with
|
LinearOpExpr
(
TOp
.
UnionCase
c
,
tyargs
,
argsFront
,
argLast
,
m
)
->
GenExprs
cenv
cgbuf
eenv
argsFront
...
...
@@ -2564,9 +2568,6 @@ and GenLinearExpr cenv cgbuf eenv sp expr sequel canProcessSequencePoint (contf:
Fake
))
|
Expr
.
Sequential
(
e1
,
e2
,
specialSeqFlag
,
spSeq
,
_)
->
if
canProcessSequencePoint
then
ProcessSequencePointForExpr
cenv
cgbuf
sp
expr
// Compiler generated sequential executions result in suppressions of sequence points on both
// left and right of the sequence
let
spAction
,
spExpr
=
...
...
@@ -2585,9 +2586,6 @@ and GenLinearExpr cenv cgbuf eenv sp expr sequel canProcessSequencePoint (contf:
contf
Fake
|
Expr
.
Let
(
bind
,
body
,
_,
_)
->
if
canProcessSequencePoint
then
ProcessSequencePointForExpr
cenv
cgbuf
sp
expr
// This case implemented here to get a guaranteed tailcall
// Make sure we generate the sequence point outside the scope of the variable
let
startScope
,
endScope
as
scopeMarks
=
StartDelayedLocalScope
"let"
cgbuf
...
...
@@ -2609,6 +2607,11 @@ and GenLinearExpr cenv cgbuf eenv sp expr sequel canProcessSequencePoint (contf:
// Generate the body
GenLinearExpr
cenv
cgbuf
eenv
spBody
body
(
EndLocalScope
(
sequel
,
endScope
))
(* canProcessSequencePoint *)
true
contf
|
LinearMatchExpr
(
spBind
,
exprm
,
tree
,
tg1
,
e2
,
spTg2
,
m
,
ty
)
->
GenMatch
cenv
cgbuf
eenv
(
spBind
,
exprm
,
tree
,
[|
tg1
;
TTarget
([],
e2
,
spTg2
)|],
m
,
ty
)
sequel
contf
Fake
//| Expr.Match (spBind, exprm, tree, targets, m, ty) ->
// GenMatch cenv cgbuf eenv (spBind, exprm, tree, targets, m, ty) sequel
|
_
->
GenExpr
cenv
cgbuf
eenv
sp
expr
sequel
contf
Fake
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录