Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6142611

Browse files
authored
cleanup and comments (dotnet#2478)
* cleanup and comments* fix build
1 parenta3b458d commit6142611

18 files changed

+391
-262
lines changed

‎src/fsharp/AugmentWithHashCompare.fs‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ let mkExnEquality (g: TcGlobals) exnref (exnc:Tycon) =
298298
letexpr=
299299
letmbuilder=new MatchBuilder(NoSequencePointAtInvisibleBinding,m)
300300
letcases=
301-
[ mkCase(Test.IsInst(g.exn_ty,mkAppTy exnref[]),
301+
[ mkCase(DecisionTreeTest.IsInst(g.exn_ty,mkAppTy exnref[]),
302302
mbuilder.AddResultTarget(expr,SuppressSequencePointAtTarget))]
303303
letdflt= Some(mbuilder.AddResultTarget(mkFalse g m,SuppressSequencePointAtTarget))
304304
letdtree= TDSwitch(thate,cases,dflt,m)
@@ -322,7 +322,7 @@ let mkExnEqualityWithComparer g exnref (exnc:Tycon) (_thisv,thise) thatobje (tha
322322
letexpr=
323323
letmbuilder=new MatchBuilder(NoSequencePointAtInvisibleBinding,m)
324324
letcases=
325-
[ mkCase(Test.IsInst(g.exn_ty,mkAppTy exnref[]),
325+
[ mkCase(DecisionTreeTest.IsInst(g.exn_ty,mkAppTy exnref[]),
326326
mbuilder.AddResultTarget(expr,SuppressSequencePointAtTarget))]
327327
letdflt= mbuilder.AddResultTarget(mkFalse g m,SuppressSequencePointAtTarget)
328328
letdtree= TDSwitch(thate,cases,Some dflt,m)
@@ -363,7 +363,7 @@ let mkUnionCompare g tcref (tycon:Tycon) =
363363
mkCompGenLet m thisucv(mkUnionCaseProof(thise,cref,tinst,m))
364364
(mkCompGenLet m thatucv(mkUnionCaseProof(thataddre,cref,tinst,m))
365365
(mkCompareTestConjuncts g m(List.mapi(mkTest thisucve thatucve) rfields)))
366-
Some(mkCase(Test.UnionCase(cref,tinst),mbuilder.AddResultTarget(test,SuppressSequencePointAtTarget)))
366+
Some(mkCase(DecisionTreeTest.UnionCase(cref,tinst),mbuilder.AddResultTarget(test,SuppressSequencePointAtTarget)))
367367

368368
letnullary,nonNullary= List.partition Option.isNone(List.map mkCase ucases)
369369
if isNil nonNullarythen mkZero g melse
@@ -423,7 +423,7 @@ let mkUnionCompareWithComparer g tcref (tycon:Tycon) (_thisv,thise) (_thatobjv,t
423423
(mkCompGenLet m thatucv(mkUnionCaseProof(thataddre,cref,tinst,m))
424424
(mkCompareTestConjuncts g m(List.mapi(mkTest thisucve thatucve) rfields)))
425425

426-
Some(mkCase(Test.UnionCase(cref,tinst),mbuilder.AddResultTarget(test,SuppressSequencePointAtTarget)))
426+
Some(mkCase(DecisionTreeTest.UnionCase(cref,tinst),mbuilder.AddResultTarget(test,SuppressSequencePointAtTarget)))
427427

428428
letnullary,nonNullary= List.partition Option.isNone(List.map mkCase ucases)
429429
if isNil nonNullarythen mkZero g melse
@@ -483,7 +483,7 @@ let mkUnionEquality g tcref (tycon:Tycon) =
483483
(mkCompGenLet m thatucv(mkUnionCaseProof(thataddre,cref,tinst,m))
484484
(mkEqualsTestConjuncts g m(List.mapi(mkTest thisucve thatucve) rfields)))
485485

486-
Some(mkCase(Test.UnionCase(cref,tinst), mbuilder.AddResultTarget(test, SuppressSequencePointAtTarget)))
486+
Some(mkCase(DecisionTreeTest.UnionCase(cref,tinst), mbuilder.AddResultTarget(test, SuppressSequencePointAtTarget)))
487487

488488
letnullary,nonNullary= List.partition Option.isNone(List.map mkCase ucases)
489489
if isNil nonNullarythen mkTrue g melse
@@ -546,7 +546,7 @@ let mkUnionEqualityWithComparer g tcref (tycon:Tycon) (_thisv,thise) thatobje (t
546546
(mkCompGenLet m thatucv(mkUnionCaseProof(thataddre,cref,tinst,m))
547547
(mkEqualsTestConjuncts g m(List.mapi(mkTest thisucve thatucve) rfields)))
548548

549-
Some(mkCase(Test.UnionCase(cref,tinst), mbuilder.AddResultTarget(test, SuppressSequencePointAtTarget)))
549+
Some(mkCase(DecisionTreeTest.UnionCase(cref,tinst), mbuilder.AddResultTarget(test, SuppressSequencePointAtTarget)))
550550

551551
letnullary,nonNullary= List.partition Option.isNone(List.map mkCase ucases)
552552
if isNil nonNullarythen mkTrue g melse
@@ -645,7 +645,7 @@ let mkUnionHashWithComparer g tcref (tycon:Tycon) compe =
645645
(mkCompGenSequential m
646646
(mkValSet m(mkLocalValRef accv)(mkInt g m i))
647647
(mkCombineHashGenerators g m(List.mapi(mkHash ucve) ucase1.RecdFields)(mkLocalValRef accv) acce))
648-
Some(mkCase(Test.UnionCase(c1ref,tinst),mbuilder.AddResultTarget(test,SuppressSequencePointAtTarget)))
648+
Some(mkCase(DecisionTreeTest.UnionCase(c1ref,tinst),mbuilder.AddResultTarget(test,SuppressSequencePointAtTarget)))
649649

650650
letnullary,nonNullary= ucases
651651
|> List.mapi mkCase

‎src/fsharp/DetupleArgs.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ module GlobalUsageAnalysis =
196196
/// bound in a decision tree?
197197
DecisionTreeBindings:Zset<Val>
198198
/// v -> v list * recursive? -- the others in the mutual binding
199-
RecursiveBindings:Zmap<Val,bool*FlatVals>
199+
RecursiveBindings:Zmap<Val,bool*Vals>
200200
TopLevelBindings:Zset<Val>
201201
IterationIsAtTopLevel:bool}
202202

‎src/fsharp/DetupleArgs.fsi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module GlobalUsageAnalysis =
3030
/// bound in a decision tree?
3131
DecisionTreeBindings:Zset<Val>;
3232
/// v -> recursive? * v list -- the others in the mutual binding
33-
RecursiveBindings:Zmap<Val,(bool*FlatVals)>;
33+
RecursiveBindings:Zmap<Val,(bool*Vals)>;
3434
/// val not defined under lambdas
3535
TopLevelBindings:Zset<Val>;
3636
/// top of expr toplevel? (true)

‎src/fsharp/FindUnsolved.fs‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,13 @@ and accLambdas cenv env topValInfo e ety =
148148
accExpr cenv env e
149149

150150
andaccExprs cenv env exprs= exprs|> List.iter(accExpr cenv env)
151-
andaccFlatExprs cenv env exprs= exprs|> List.iter(accExpr cenv env)
152151
andaccTargets cenv env m ty targets= Array.iter(accTarget cenv env m ty) targets
153152

154153
andaccTarget cenv env _m _ty(TTarget(_vs,e,_))= accExpr cenv env e
155154

156155
andaccDTree cenv env x=
157156
match xwith
158-
| TDSuccess(es,_n)->accFlatExprs cenv env es
157+
| TDSuccess(es,_n)->accExprs cenv env es
159158
| TDBind(bind,rest)-> accBind cenv env bind; accDTree cenv env rest
160159
| TDSwitch(e,cases,dflt,m)-> accSwitch cenv env(e,cases,dflt,m)
161160

@@ -166,12 +165,12 @@ and accSwitch cenv env (e,cases,dflt,_m) =
166165

167166
andaccDiscrim cenv env d=
168167
match dwith
169-
|Test.UnionCase(_ucref,tinst)-> accTypeInst cenv env tinst
170-
|Test.ArrayLength(_,ty)-> accTy cenv env ty
171-
|Test.Const_
172-
|Test.IsNull->()
173-
|Test.IsInst(srcty,tgty)-> accTy cenv env srcty; accTy cenv env tgty
174-
|Test.ActivePatternCase(exp, tys,_,_,_)->
168+
|DecisionTreeTest.UnionCase(_ucref,tinst)-> accTypeInst cenv env tinst
169+
|DecisionTreeTest.ArrayLength(_,ty)-> accTy cenv env ty
170+
|DecisionTreeTest.Const_
171+
|DecisionTreeTest.IsNull->()
172+
|DecisionTreeTest.IsInst(srcty,tgty)-> accTy cenv env srcty; accTy cenv env tgty
173+
|DecisionTreeTest.ActivePatternCase(exp, tys,_,_,_)->
175174
accExpr cenv env exp
176175
accTypeInst cenv env tys
177176

‎src/fsharp/IlxGen.fs‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,7 +4300,7 @@ and GenDecisionTreeSuccess cenv cgbuf inplabOpt stackAtTargets eenv es targetIdx
43004300
lettargetMarkBeforeBinds= CG.GenerateDelayMark cgbuf"targetBeforeBinds"
43014301
lettargetMarkAfterBinds= CG.GenerateDelayMark cgbuf"targetAfterBinds"
43024302
letstartScope,endScope as scopeMarks= StartDelayedLocalScope"targetBinds" cgbuf
4303-
letbinds=mkInvisibleFlatBindings vs es
4303+
letbinds=mkInvisibleBinds vs es
43044304
leteenvAtTarget= AllocStorageForBinds cenv cgbuf scopeMarks eenv binds
43054305
lettargetInfo=(targetMarkBeforeBinds,targetMarkAfterBinds,eenvAtTarget,successExpr,spTarget,repeatSP,vs,binds,startScope,endScope)
43064306

@@ -4353,18 +4353,18 @@ and GenDecisionTreeSwitch cenv cgbuf inplabOpt stackAtTargets eenv e cases defau
43534353
repeatSP()
43544354
match caseswith
43554355
// optimize a test against a boolean value, i.e. the all-important if-then-else
4356-
| TCase(Test.Const(Const.Bool b), successTree)::_->
4356+
| TCase(DecisionTreeTest.Const(Const.Bool b), successTree)::_->
43574357
letfailureTree=(match defaultTargetOptwith None-> cases.Tail.Head.CaseTree| Some d-> d)
43584358
GenDecisionTreeTest cenv eenv.cloc cgbuf stackAtTargets e None eenv(if bthen successTreeelse failureTree)(if bthen failureTreeelse successTree) targets repeatSP targetInfos sequel
43594359

43604360
// // Remove a single test for a union case . Union case tests are always exa
4361-
//| [ TCase(Test.UnionCase _, successTree) ] when (defaultTargetOpt.IsNone) ->
4361+
//| [ TCase(DecisionTreeTest.UnionCase _, successTree) ] when (defaultTargetOpt.IsNone) ->
43624362
// GenDecisionTreeAndTargetsInner cenv cgbuf inplabOpt stackAtTargets eenv successTree targets repeatSP targetInfos sequel
43634363
// //GenDecisionTree cenv eenv.cloc cgbuf stackAtTargets e (Some (pop 1, Push [cenv.g.ilg.typ_Bool], Choice1Of2 (avoidHelpers, cuspec, idx))) eenv successTree failureTree targets repeatSP targetInfos sequel
43644364

43654365
// Optimize a single test for a union case to an "isdata" test - much
43664366
// more efficient code, and this case occurs in the generated equality testers where perf is important
4367-
| TCase(Test.UnionCase(c,tyargs), successTree):: restwhen rest.Length=(match defaultTargetOptwith None->1| Some_->0)->
4367+
| TCase(DecisionTreeTest.UnionCase(c,tyargs), successTree):: restwhen rest.Length=(match defaultTargetOptwith None->1| Some_->0)->
43684368
letfailureTree=
43694369
match defaultTargetOptwith
43704370
| None-> rest.Head.CaseTree
@@ -4380,48 +4380,48 @@ and GenDecisionTreeSwitch cenv cgbuf inplabOpt stackAtTargets eenv e cases defau
43804380
match firstDiscrimwith
43814381
// Iterated tests, e.g. exception constructors, nulltests, typetests and active patterns.
43824382
// These should always have one positive and one negative branch
4383-
|Test.IsInst_
4384-
|Test.ArrayLength_
4385-
|Test.IsNull
4386-
|Test.Const(Const.Zero)->
4387-
if List.length cases<>1|| Option.isNone defaultTargetOptthen failwith"internal error: GenDecisionTreeSwitch:Test.IsInst/isnull/query"
4383+
|DecisionTreeTest.IsInst_
4384+
|DecisionTreeTest.ArrayLength_
4385+
|DecisionTreeTest.IsNull
4386+
|DecisionTreeTest.Const(Const.Zero)->
4387+
if List.length cases<>1|| Option.isNone defaultTargetOptthen failwith"internal error: GenDecisionTreeSwitch:DecisionTreeTest.IsInst/isnull/query"
43884388
letbi=
43894389
match firstDiscrimwith
4390-
|Test.Const(Const.Zero)->
4390+
|DecisionTreeTest.Const(Const.Zero)->
43914391
GenExpr cenv cgbuf eenv SPSuppress e Continue
43924392
BI_brfalse
4393-
|Test.IsNull->
4393+
|DecisionTreeTest.IsNull->
43944394
GenExpr cenv cgbuf eenv SPSuppress e Continue
43954395
letsrcTy= tyOfExpr cenv.g e
43964396
if isTyparTy cenv.g srcTythen
43974397
letilFromTy= GenType cenv.amap m eenv.tyenv srcTy
43984398
CG.EmitInstr cgbuf(pop1)(Push[cenv.g.ilg.typ_Object])(I_box ilFromTy)
43994399
BI_brfalse
4400-
|Test.IsInst(_srcty,tgty)->
4400+
|DecisionTreeTest.IsInst(_srcty,tgty)->
44014401
lete= mkCallTypeTest cenv.g m tgty e
44024402
GenExpr cenv cgbuf eenv SPSuppress e Continue
44034403
BI_brtrue
44044404
|_-> failwith"internal error: GenDecisionTreeSwitch"
44054405
CG.EmitInstr cgbuf(pop1) Push0(I_brcmp(bi,(List.head caseLabels).CodeLabel))
44064406
GenDecisionTreeCases cenv cgbuf stackAtTargets eenv targets repeatSP targetInfos defaultTargetOpt caseLabels cases sequel
44074407

4408-
|Test.ActivePatternCase_-> error(InternalError("internal error in codegen:Test.ActivePatternCase",switchm))
4409-
|Test.UnionCase(hdc,tyargs)->
4408+
|DecisionTreeTest.ActivePatternCase_-> error(InternalError("internal error in codegen:DecisionTreeTest.ActivePatternCase",switchm))
4409+
|DecisionTreeTest.UnionCase(hdc,tyargs)->
44104410
GenExpr cenv cgbuf eenv SPSuppress e Continue
44114411
letcuspec= GenUnionSpec cenv.amap m eenv.tyenv hdc.TyconRef tyargs
44124412
letdests=
4413-
if cases.Length<> caseLabels.Lengththen failwith"internal error:Test.UnionCase"
4413+
if cases.Length<> caseLabels.Lengththen failwith"internal error:DecisionTreeTest.UnionCase"
44144414
(cases, caseLabels)||> List.map2(fun case label->
44154415
match casewith
4416-
| TCase(Test.UnionCase(c,_),_)->(c.Index, label.CodeLabel)
4416+
| TCase(DecisionTreeTest.UnionCase(c,_),_)->(c.Index, label.CodeLabel)
44174417
|_-> failwith"error: mixed constructor/const test?")
44184418

44194419
letavoidHelpers= entityRefInThisAssembly cenv.g.compilingFslib hdc.TyconRef
44204420
EraseUnions.emitDataSwitch cenv.g.ilg(UnionCodeGen cgbuf)(avoidHelpers,cuspec,dests)
44214421
CG.EmitInstrs cgbuf(pop1) Push0[]// push/pop to match the line above
44224422
GenDecisionTreeCases cenv cgbuf stackAtTargets eenv targets repeatSP targetInfos defaultTargetOpt caseLabels cases sequel
44234423

4424-
|Test.Const c->
4424+
|DecisionTreeTest.Const c->
44254425
GenExpr cenv cgbuf eenv SPSuppress e Continue
44264426
match cwith
44274427
| Const.Bool_-> failwith"should have been done earlier"
@@ -4437,7 +4437,7 @@ and GenDecisionTreeSwitch cenv cgbuf inplabOpt stackAtTargets eenv e cases defau
44374437
(cases,caseLabels)||> List.map2(fun case label->
44384438
leti=
44394439
match case.Discriminatorwith
4440-
Test.Const c'->
4440+
DecisionTreeTest.Const c'->
44414441
match c'with
44424442
| Const.SByte i-> int32 i
44434443
| Const.Int16 i-> int32 i

‎src/fsharp/LowerCallsAndSeqs.fs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,10 @@ let LowerSeqExpr g amap overallExpr =
521521
[
522522
// no disposal action for the initial state (pc = 0)
523523
if isDisposalthen
524-
yield mkCase(Test.Const(Const.Int32 pcInit),mkGotoLabelTarget noDisposeContinuationLabel)
524+
yield mkCase(DecisionTreeTest.Const(Const.Int32 pcInit),mkGotoLabelTarget noDisposeContinuationLabel)
525525
for pcin pcsdo
526-
yield mkCase(Test.Const(Const.Int32 pc),mkGotoLabelTarget pc2lab.[pc])
527-
yield mkCase(Test.Const(Const.Int32 pcDone),mkGotoLabelTarget noDisposeContinuationLabel)],
526+
yield mkCase(DecisionTreeTest.Const(Const.Int32 pc),mkGotoLabelTarget pc2lab.[pc])
527+
yield mkCase(DecisionTreeTest.Const(Const.Int32 pcDone),mkGotoLabelTarget noDisposeContinuationLabel)],
528528
Some(mkGotoLabelTarget pc2lab.[pcInit]),
529529
m)
530530

@@ -561,7 +561,7 @@ let LowerSeqExpr g amap overallExpr =
561561
letaddResultTarget e= mbuilder.AddResultTarget(e, SuppressSequencePointAtTarget)
562562
letdtree=
563563
TDSwitch(pce,
564-
[ mkCase((Test.Const(Const.Int32 pcDone)), addResultTarget(Expr.Op(TOp.Goto doneLabel,[],[], m)))],
564+
[ mkCase((DecisionTreeTest.Const(Const.Int32 pcDone)), addResultTarget(Expr.Op(TOp.Goto doneLabel,[],[], m)))],
565565
Some(addResultTarget(mkUnit g m)),
566566
m)
567567
letpcIsEndStateComparison= mbuilder.Close(dtree,m,g.unit_ty)

‎src/fsharp/NicePrint.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ module internal PrintUtilities =
8787
if denv.shortTypeNamesthen
8888
tyconTextL
8989
else
90-
letpath=demangledPathOfCompPathtcref.CompilationPath
90+
letpath= tcref.CompilationPath.DemangledPath
9191
letpath=
9292
if denv.includeStaticParametersInTypeNamesthen
9393
path

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp