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

Commit12e4d2a

Browse files
dsymecartermp
authored andcommitted
add some docs (dotnet#6138)
* add some docs* more docs* more docs* more docs/spacing* more docs/spacing* more docs/spacing
1 parent7584974 commit12e4d2a

File tree

6 files changed

+957
-315
lines changed

6 files changed

+957
-315
lines changed

‎src/fsharp/IlxGen.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ let StorageForVal m v eenv =
764764
try eenv.valsInScope.[v]
765765
with:? KeyNotFoundException->
766766
assertfalse
767-
errorR(Error(FSComp.SR.ilUndefinedValue(showL(vspecAtBindL v)),m))
767+
errorR(Error(FSComp.SR.ilUndefinedValue(showL(valAtBindL v)),m))
768768
notlazy(Arg668(* random value for post-hoc diagnostic analysis on generated tree*))
769769
v.Force()
770770

‎src/fsharp/Optimizer.fs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -976,11 +976,11 @@ let AbstractLazyModulInfoByHiding isAssemblyBoundary mhi =
976976
// Under those checks, the further hidden* checks may be subsumed (meaning, not required anymore).
977977

978978
lethiddenTycon,hiddenTyconRepr,hiddenVal,hiddenRecdField,hiddenUnionCase=
979-
Zset.memberOf mhi.mhiTycons,
980-
Zset.memberOf mhi.mhiTyconReprs,
981-
Zset.memberOf mhi.mhiVals,
982-
Zset.memberOf mhi.mhiRecdFields,
983-
Zset.memberOf mhi.mhiUnionCases
979+
Zset.memberOf mhi.HiddenTycons,
980+
Zset.memberOf mhi.HiddenTyconReprs,
981+
Zset.memberOf mhi.HiddenVals,
982+
Zset.memberOf mhi.HiddenRecdFields,
983+
Zset.memberOf mhi.HiddenUnionCases
984984

985985
let recabstractExprInfo ivalue=
986986
match ivaluewith
@@ -3229,7 +3229,7 @@ and OptimizeModuleExpr cenv env x =
32293229
not(ValueIsUsedOrHasEffect cenv(fun()-> fvs.FreeLocals)(bind, binfo))&&
32303230

32313231
// Check the thing is hidden by the signature (if any)
3232-
hidden.mhiVals.Contains bind.Var&&
3232+
hidden.HiddenVals.Contains bind.Var&&
32333233

32343234
// Check the thing is not compiled as a static field or property, since reflected definitions and other reflective stuff might need it
32353235
not(IsCompiledAsStaticProperty cenv.g bind.Var))

‎src/fsharp/SignatureConformance.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) =
3737
// Used when checking attributes.
3838
letsigToImplRemap=
3939
letremap= Remap.Empty
40-
letremap=(remapInfo.mrpiEntities,remap)||> List.foldBack(fun(implTcref,signTcref)acc-> addTyconRefRemap signTcref implTcref acc)
41-
letremap=(remapInfo.mrpiVals,remap)||> List.foldBack(fun(implValRef,signValRef)acc-> addValRemap signValRef.Deref implValRef.Deref acc)
40+
letremap=(remapInfo.RepackagedEntities,remap)||> List.foldBack(fun(implTcref,signTcref)acc-> addTyconRefRemap signTcref implTcref acc)
41+
letremap=(remapInfo.RepackagedVals,remap)||> List.foldBack(fun(implValRef,signValRef)acc-> addValRemap signValRef.Deref implValRef.Deref acc)
4242
remap
4343

4444
// For all attributable elements (types, modules, exceptions, record fields, unions, parameters, generic type parameters)

‎src/fsharp/TastOps.fs‎

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3442,7 +3442,7 @@ module DebugPrint = begin
34423442
let recMemberL(v:Val)(membInfo:ValMemberInfo)=
34433443
(aboveListL[ wordL(tagText"compiled_name! =")^^ wordL(tagText v.CompiledName);
34443444
wordL(tagText"membInfo-slotsig! =")^^ listL slotSigL membInfo.ImplementedSlotSigs])
3445-
andvspecAtBindL v=
3445+
andvalAtBindL v=
34463446
letvL= valL vin
34473447
letmutL=(if v.IsMutablethen wordL(tagText"mutable")++ vLelse vL)
34483448
mutL---(aboveListL(List.concat[[wordL(tagText":")^^ typeL v.Type];
@@ -3512,7 +3512,7 @@ module DebugPrint = begin
35123512
then emptyL
35133513
else
35143514
letiimplsLs= iimpls|> List.map(fun(ty,_,_)-> wordL(tagText"interface")--- typeL ty)
3515-
letadhocLs= adhoc|> List.map(fun vref->vspecAtBindL vref.Deref)
3515+
letadhocLs= adhoc|> List.map(fun vref->valAtBindL vref.Deref)
35163516
(wordL(tagText"with")@@-- aboveListL(iimplsLs@ adhocLs))@@ wordL(tagText"end")
35173517

35183518
letlayoutUnionCaseArgTypes argtys= sepListL(wordL(tagText"*"))(List.map typeL argtys)
@@ -3559,7 +3559,7 @@ module DebugPrint = begin
35593559
letvsprs=
35603560
tycon.MembersOfFSharpTyconSorted
35613561
|> List.filter(fun v-> v.IsDispatchSlot)
3562-
|> List.map(fun vref->vspecAtBindL vref.Deref)
3562+
|> List.map(fun vref->valAtBindL vref.Deref)
35633563
letvals= tycon.TrueFieldsAsList|> List.map(fun f->(if f.IsStaticthen wordL(tagText"static")else emptyL)^^ wordL(tagText"val")^^ layoutRecdField f)
35643564
letalldecls= inherits@ vsprs@ vals
35653565
letemptyMeasure=match tycon.TypeOrMeasureKindwith TyparKind.Measure-> isNil alldecls|_->false
@@ -3590,7 +3590,7 @@ module DebugPrint = begin
35903590
//--------------------------------------------------------------------------
35913591

35923592
andbindingL(TBind(v,repr,_))=
3593-
vspecAtBindL v---(wordL(tagText"=")^^ exprL repr)
3593+
valAtBindL v---(wordL(tagText"=")^^ exprL repr)
35943594

35953595
andexprL expr= exprWrapLfalse expr
35963596
andatomL expr= exprWrapLtrue expr// true means bracket if needed to be atomic expr
@@ -3628,11 +3628,11 @@ module DebugPrint = begin
36283628
| ThenDoSeq->"; (*ThenDo*)"
36293629
((exprL x0^^ rightL(tagText flag))@@ exprL x1)|> wrap
36303630
| Expr.Lambda(_,_, baseValOpt, argvs, body,_,_)->
3631-
letformalsL= spaceListL(List.mapvspecAtBindL argvs)in
3631+
letformalsL= spaceListL(List.mapvalAtBindL argvs)in
36323632
letbindingL=
36333633
match baseValOptwith
36343634
| None-> wordL(tagText"lam")^^ formalsL^^ rightL(tagText".")
3635-
| Some basev-> wordL(tagText"lam")^^(leftL(tagText"base=")^^vspecAtBindL basev)--- formalsL^^ rightL(tagText".")in
3635+
| Some basev-> wordL(tagText"lam")^^(leftL(tagText"base=")^^valAtBindL basev)--- formalsL^^ rightL(tagText".")in
36363636
(bindingL++ exprL body)|> wrap
36373637
| Expr.TyLambda(_, argtyvs, body,_,_)->
36383638
((wordL(tagText"LAM")^^ spaceListL(List.map typarL argtyvs)^^ rightL(tagText"."))++ exprL body)|> wrap
@@ -3727,7 +3727,7 @@ module DebugPrint = begin
37273727
| Expr.Obj(_lambdaId, ty, basev, ccall, overrides, iimpls,_)->
37283728
wordL(tagText"OBJ:")^^ aboveListL[typeL ty;
37293729
exprL ccall;
3730-
optionLvspecAtBindL basev;
3730+
optionLvalAtBindL basev;
37313731
aboveListL(List.map overrideL overrides);
37323732
aboveListL(List.map iimplL iimpls)]
37333733

@@ -3812,7 +3812,7 @@ module DebugPrint = begin
38123812
andtmethodL(TObjExprMethod(TSlotSig(nm,_,_,_,_,_),_,tps,vs,e,_))=
38133813
(wordL(tagText"TObjExprMethod")---(wordL(tagText nm))^^ wordL(tagText"="))--
38143814
(wordL(tagText"METH-LAM")--- angleBracketListL(List.map typarL tps)^^ rightL(tagText"."))---
3815-
(wordL(tagText"meth-lam")--- tupleL(List.map(List.mapvspecAtBindL>> tupleL) vs)^^ rightL(tagText"."))---
3815+
(wordL(tagText"meth-lam")--- tupleL(List.map(List.mapvalAtBindL>> tupleL) vs)^^ rightL(tagText"."))---
38163816
(atomL e)
38173817
andoverrideL tmeth= wordL(tagText"with")^^ tmethodL tmeth
38183818
andiimplL(ty,tmeths)= wordL(tagText"impl")^^ aboveListL(typeL ty:: List.map tmethodL tmeths)
@@ -3850,33 +3850,33 @@ let SigTypeOfImplFile (TImplFile(_, _, mexpr, _, _, _)) = mexpr.Type
38503850
//--------------------------------------------------------------------------
38513851

38523852
typeSignatureRepackageInfo=
3853-
{mrpiVals:(ValRef* ValRef) list;
3854-
mrpiEntities:(TyconRef* TyconRef) list}
3853+
{RepackagedVals:(ValRef* ValRef) list;
3854+
RepackagedEntities:(TyconRef* TyconRef) list}
38553855

3856-
memberremapInfo.ImplToSigMapping={ TypeEquivEnv.Emptywith EquivTycons= TyconRefMap.OfList remapInfo.mrpiEntities}
3857-
static memberEmpty={mrpiVals=[];mrpiEntities=[]}
3856+
memberremapInfo.ImplToSigMapping={ TypeEquivEnv.Emptywith EquivTycons= TyconRefMap.OfList remapInfo.RepackagedEntities}
3857+
static memberEmpty={RepackagedVals=[];RepackagedEntities=[]}
38583858

38593859
typeSignatureHidingInfo=
3860-
{mhiTycons:Zset<Tycon>;
3861-
mhiTyconReprs:Zset<Tycon>;
3862-
mhiVals:Zset<Val>;
3863-
mhiRecdFields:Zset<RecdFieldRef>;
3864-
mhiUnionCases:Zset<UnionCaseRef>}
3860+
{HiddenTycons:Zset<Tycon>;
3861+
HiddenTyconReprs:Zset<Tycon>;
3862+
HiddenVals:Zset<Val>;
3863+
HiddenRecdFields:Zset<RecdFieldRef>;
3864+
HiddenUnionCases:Zset<UnionCaseRef>}
38653865

38663866
static memberEmpty=
3867-
{mhiTycons= Zset.empty tyconOrder;
3868-
mhiTyconReprs= Zset.empty tyconOrder;
3869-
mhiVals= Zset.empty valOrder;
3870-
mhiRecdFields= Zset.empty recdFieldRefOrder;
3871-
mhiUnionCases= Zset.empty unionCaseRefOrder}
3867+
{HiddenTycons= Zset.empty tyconOrder;
3868+
HiddenTyconReprs= Zset.empty tyconOrder;
3869+
HiddenVals= Zset.empty valOrder;
3870+
HiddenRecdFields= Zset.empty recdFieldRefOrder;
3871+
HiddenUnionCases= Zset.empty unionCaseRefOrder}
38723872

38733873
letaddValRemap v v' tmenv=
38743874
{ tmenvwith valRemap= tmenv.valRemap.Add v(mkLocalValRef v')}
38753875

38763876
letmkRepackageRemapping mrpi=
3877-
{ valRemap= ValMap.OfList(mrpi.mrpiVals|> List.map(fun(vref,x)-> vref.Deref, x));
3877+
{ valRemap= ValMap.OfList(mrpi.RepackagedVals|> List.map(fun(vref,x)-> vref.Deref, x));
38783878
tpinst= emptyTyparInst;
3879-
tyconRefRemap= TyconRefMap.OfList mrpi.mrpiEntities
3879+
tyconRefRemap= TyconRefMap.OfList mrpi.RepackagedEntities
38803880
removeTraitSolutions=false}
38813881

38823882
//--------------------------------------------------------------------------
@@ -3888,18 +3888,18 @@ let accEntityRemap (msigty:ModuleOrNamespaceType) (entity:Entity) (mrpi, mhi) =
38883888
match sigtyconOptwith
38893889
| None->
38903890
// The type constructor is not present in the signature. Hence it is hidden.
3891-
letmhi={ mhiwithmhiTycons= Zset.add entity mhi.mhiTycons}
3891+
letmhi={ mhiwithHiddenTycons= Zset.add entity mhi.HiddenTycons}
38923892
(mrpi, mhi)
38933893
| Some sigtycon->
38943894
// The type constructor is in the signature. Hence record the repackage entry
38953895
letsigtcref= mkLocalTyconRef sigtycon
38963896
lettcref= mkLocalTyconRef entity
3897-
letmrpi={ mrpiwithmrpiEntities=((tcref, sigtcref):: mrpi.mrpiEntities)}
3897+
letmrpi={ mrpiwithRepackagedEntities=((tcref, sigtcref):: mrpi.RepackagedEntities)}
38983898
// OK, now look for hidden things
38993899
letmhi=
39003900
if(match entity.TypeReprInfowith TNoRepr->false|_->true)&&(match sigtycon.TypeReprInfowith TNoRepr->true|_->false)then
39013901
// The type representation is absent in the signature, hence it is hidden
3902-
{ mhiwithmhiTyconReprs= Zset.add entity mhi.mhiTyconReprs}
3902+
{ mhiwithHiddenTyconReprs= Zset.add entity mhi.HiddenTyconReprs}
39033903
else
39043904
// The type representation is present in the signature.
39053905
// Find the fields that have been hidden or which were non-public anyway.
@@ -3912,7 +3912,7 @@ let accEntityRemap (msigty:ModuleOrNamespaceType) (entity:Entity) (mrpi, mhi) =
39123912
|_->
39133913
// The field is not in the signature. Hence it is regarded as hidden.
39143914
letrfref= tcref.MakeNestedRecdFieldRef rfield
3915-
{ mhiwithmhiRecdFields= Zset.add rfref mhi.mhiRecdFields})
3915+
{ mhiwithHiddenRecdFields= Zset.add rfref mhi.HiddenRecdFields})
39163916
entity.AllFieldsArray
39173917
|> List.foldBack(fun(ucase:UnionCase)mhi->
39183918
match sigtycon.GetUnionCaseByName ucase.DisplayNamewith
@@ -3922,7 +3922,7 @@ let accEntityRemap (msigty:ModuleOrNamespaceType) (entity:Entity) (mrpi, mhi) =
39223922
|_->
39233923
// The constructor is not in the signature. Hence it is regarded as hidden.
39243924
letucref= tcref.MakeNestedUnionCaseRef ucase
3925-
{ mhiwithmhiUnionCases= Zset.add ucref mhi.mhiUnionCases})
3925+
{ mhiwithHiddenUnionCases= Zset.add ucref mhi.HiddenUnionCases})
39263926
(entity.UnionCasesAsList)
39273927
(mrpi, mhi)
39283928

@@ -3931,13 +3931,13 @@ let accSubEntityRemap (msigty:ModuleOrNamespaceType) (entity:Entity) (mrpi, mhi)
39313931
match sigtyconOptwith
39323932
| None->
39333933
// The type constructor is not present in the signature. Hence it is hidden.
3934-
letmhi={ mhiwithmhiTycons= Zset.add entity mhi.mhiTycons}
3934+
letmhi={ mhiwithHiddenTycons= Zset.add entity mhi.HiddenTycons}
39353935
(mrpi, mhi)
39363936
| Some sigtycon->
39373937
// The type constructor is in the signature. Hence record the repackage entry
39383938
letsigtcref= mkLocalTyconRef sigtycon
39393939
lettcref= mkLocalTyconRef entity
3940-
letmrpi={ mrpiwithmrpiEntities=((tcref, sigtcref):: mrpi.mrpiEntities)}
3940+
letmrpi={ mrpiwithRepackagedEntities=((tcref, sigtcref):: mrpi.RepackagedEntities)}
39413941
(mrpi, mhi)
39423942

39433943
letvalLinkageAEquiv g aenv(v1:Val)(v2:Val)=
@@ -3955,11 +3955,11 @@ let accValRemap g aenv (msigty:ModuleOrNamespaceType) (implVal:Val) (mrpi, mhi)
39553955
match sigValOptwith
39563956
| None->
39573957
if verbosethen dprintf"accValRemap, hide =%s#%d\n" implVal.LogicalName implVal.Stamp
3958-
letmhi={ mhiwithmhiVals= Zset.add implVal mhi.mhiVals}
3958+
letmhi={ mhiwithHiddenVals= Zset.add implVal mhi.HiddenVals}
39593959
(mrpi, mhi)
39603960
| Some(sigVal:Val)->
39613961
// The value is in the signature. Add the repackage entry.
3962-
letmrpi={ mrpiwithmrpiVals=(vref, mkLocalValRef sigVal):: mrpi.mrpiVals}
3962+
letmrpi={ mrpiwithRepackagedVals=(vref, mkLocalValRef sigVal):: mrpi.RepackagedVals}
39633963
(mrpi, mhi)
39643964

39653965
letgetCorrespondingSigTy nm(msigty:ModuleOrNamespaceType)=
@@ -4053,25 +4053,25 @@ let ComputeRemappingFromImplementationToSignature g mdef msigty =
40534053
letaccTyconHidingInfoAtAssemblyBoundary(tycon:Tycon)mhi=
40544054
ifnot(canAccessFromEverywhere tycon.Accessibility)then
40554055
// The type constructor is not public, hence hidden at the assembly boundary.
4056-
{ mhiwithmhiTycons= Zset.add tycon mhi.mhiTycons}
4056+
{ mhiwithHiddenTycons= Zset.add tycon mhi.HiddenTycons}
40574057
elifnot(canAccessFromEverywhere tycon.TypeReprAccessibility)then
4058-
{ mhiwithmhiTyconReprs= Zset.add tycon mhi.mhiTyconReprs}
4058+
{ mhiwithHiddenTyconReprs= Zset.add tycon mhi.HiddenTyconReprs}
40594059
else
40604060
mhi
40614061
|> Array.foldBack
40624062
(fun(rfield:RecdField)mhi->
40634063
ifnot(canAccessFromEverywhere rfield.Accessibility)then
40644064
lettcref= mkLocalTyconRef tycon
40654065
letrfref= tcref.MakeNestedRecdFieldRef rfield
4066-
{ mhiwithmhiRecdFields= Zset.add rfref mhi.mhiRecdFields}
4066+
{ mhiwithHiddenRecdFields= Zset.add rfref mhi.HiddenRecdFields}
40674067
else mhi)
40684068
tycon.AllFieldsArray
40694069
|> List.foldBack
40704070
(fun(ucase:UnionCase)mhi->
40714071
ifnot(canAccessFromEverywhere ucase.Accessibility)then
40724072
lettcref= mkLocalTyconRef tycon
40734073
letucref= tcref.MakeNestedUnionCaseRef ucase
4074-
{ mhiwithmhiUnionCases= Zset.add ucref mhi.mhiUnionCases}
4074+
{ mhiwithHiddenUnionCases= Zset.add ucref mhi.HiddenUnionCases}
40754075
else mhi)
40764076
(tycon.UnionCasesAsList)
40774077

@@ -4086,7 +4086,7 @@ let accValHidingInfoAtAssemblyBoundary (vspec:Val) mhi =
40864086
// anything that's not a module or member binding gets assembly visibility
40874087
not vspec.IsMemberOrModuleBindingthen
40884088
// The value is not public, hence hidden at the assembly boundary.
4089-
{ mhiwithmhiVals= Zset.add vspec mhi.mhiVals}
4089+
{ mhiwithHiddenVals= Zset.add vspec mhi.HiddenVals}
40904090
else
40914091
mhi
40924092

@@ -4121,10 +4121,10 @@ let IsHidden setF accessF remapF debugF =
41214121
if verbosethen dprintf"IsHidden, #mrmi =%d,%s =%b\n" mrmi.Length(showL(debugF x)) res;
41224122
res
41234123

4124-
letIsHiddenTycon mrmi x= IsHidden(fun mhi-> mhi.mhiTycons)(fun tc-> tc.Accessibility)(fun rpi x->(remapTyconRef rpi.tyconRefRemap(mkLocalTyconRef x)).Deref) DebugPrint.tyconL mrmi x
4125-
letIsHiddenTyconRepr mrmi x= IsHidden(fun mhi-> mhi.mhiTyconReprs)(fun v-> v.TypeReprAccessibility)(fun rpi x->(remapTyconRef rpi.tyconRefRemap(mkLocalTyconRef x)).Deref) DebugPrint.tyconL mrmi x
4126-
letIsHiddenVal mrmi x= IsHidden(fun mhi-> mhi.mhiVals)(fun v-> v.Accessibility)(fun rpi x->(remapValRef rpi(mkLocalValRef x)).Deref) DebugPrint.valL mrmi x
4127-
letIsHiddenRecdField mrmi x= IsHidden(fun mhi-> mhi.mhiRecdFields)(fun rfref-> rfref.RecdField.Accessibility)(fun rpi x-> remapRecdFieldRef rpi.tyconRefRemap x) DebugPrint.recdFieldRefL mrmi x
4124+
letIsHiddenTycon mrmi x= IsHidden(fun mhi-> mhi.HiddenTycons)(fun tc-> tc.Accessibility)(fun rpi x->(remapTyconRef rpi.tyconRefRemap(mkLocalTyconRef x)).Deref) DebugPrint.tyconL mrmi x
4125+
letIsHiddenTyconRepr mrmi x= IsHidden(fun mhi-> mhi.HiddenTyconReprs)(fun v-> v.TypeReprAccessibility)(fun rpi x->(remapTyconRef rpi.tyconRefRemap(mkLocalTyconRef x)).Deref) DebugPrint.tyconL mrmi x
4126+
letIsHiddenVal mrmi x= IsHidden(fun mhi-> mhi.HiddenVals)(fun v-> v.Accessibility)(fun rpi x->(remapValRef rpi(mkLocalValRef x)).Deref) DebugPrint.valL mrmi x
4127+
letIsHiddenRecdField mrmi x= IsHidden(fun mhi-> mhi.HiddenRecdFields)(fun rfref-> rfref.RecdField.Accessibility)(fun rpi x-> remapRecdFieldRef rpi.tyconRefRemap x) DebugPrint.recdFieldRefL mrmi x
41284128

41294129

41304130
//--------------------------------------------------------------------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp