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

Commitb233057

Browse files
authored
cleanup extracted from span and some whitespace improvements (#4913)
* cleanup extracted from span and some whitespace improvements* remove dead code
1 parent04bef9a commitb233057

31 files changed

+635
-666
lines changed

‎src/FSharpSource.Settings.targets‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,6 @@
198198
<WarningLevelCondition=" '$(WarningLevel)' == ''">3</WarningLevel>
199199
</PropertyGroup>
200200

201-
<PropertyGroup>
202-
<DefineConstantsCondition="'$(VisualStudioVersion)'=='12.0' AND '$(ProjectLanguage)' == 'VisualBasic'">$(DefineConstants),VS_VERSION_DEV12=True</DefineConstants>
203-
<DefineConstantsCondition="'$(VisualStudioVersion)'=='12.0' AND '$(ProjectLanguage)' != 'VisualBasic'">$(DefineConstants);VS_VERSION_DEV12</DefineConstants>
204-
<DefineConstantsCondition="'$(VisualStudioVersion)'=='14.0' AND '$(ProjectLanguage)' == 'VisualBasic'">$(DefineConstants),VS_VERSION_DEV14=True</DefineConstants>
205-
<DefineConstantsCondition="'$(VisualStudioVersion)'=='14.0' AND '$(ProjectLanguage)' != 'VisualBasic'">$(DefineConstants);VS_VERSION_DEV14</DefineConstants>
206-
<DefineConstantsCondition="'$(VisualStudioVersion)'=='15.0' AND '$(ProjectLanguage)' == 'VisualBasic'">$(DefineConstants),VS_VERSION_DEV15=True</DefineConstants>
207-
<DefineConstantsCondition="'$(VisualStudioVersion)'=='15.0' AND '$(ProjectLanguage)' != 'VisualBasic'">$(DefineConstants);VS_VERSION_DEV15</DefineConstants>
208-
<!-- VisualStudioVersion is not defined when using xbuild on Mono. Assume 14.0, the last shipped in-the-box with Mono-->
209-
<DefineConstantsCondition="'$(VisualStudioVersion)'=='' AND '$(ProjectLanguage)' == 'VisualBasic'">$(DefineConstants),VS_VERSION_DEV14=True</DefineConstants>
210-
<DefineConstantsCondition="'$(VisualStudioVersion)'=='' AND '$(ProjectLanguage)' != 'VisualBasic'">$(DefineConstants);VS_VERSION_DEV14</DefineConstants>
211-
</PropertyGroup>
212-
213201
<!-- Nuget Package properties-->
214202
<PropertyGroup>
215203
<BuildRevision>$([System.DateTime]::Now.ToString(`yyMMdd`))</BuildRevision>

‎src/absil/il.fs‎

Lines changed: 79 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ type PrimaryAssembly =
7575
// --------------------------------------------------------------------
7676

7777
letsplitNameAt(nm:string)idx=
78-
if idx<0then failwith"splitNameAt: idx < 0";
78+
if idx<0then failwith"splitNameAt: idx < 0"
7979
letlast= nm.Length-1
80-
if idx> lastthen failwith"splitNameAt: idx > last";
80+
if idx> lastthen failwith"splitNameAt: idx > last"
8181
(nm.Substring(0, idx)),
8282
(if idx< lastthen nm.Substring(idx+1, last- idx)else"")
8383

@@ -230,9 +230,9 @@ module SHA1 =
230230

231231

232232
typeSHAStream=
233-
{ stream:byte[];
234-
mutable pos:int;
235-
mutable eof:bool;}
233+
{ stream:byte[]
234+
mutable pos:int
235+
mutable eof:bool}
236236

237237
letrotLeft32 x n=(x<<< n)|||(x>>>&(32-n))
238238

@@ -443,17 +443,17 @@ type ILAssemblyRef(data) =
443443
letb=new System.Text.StringBuilder(100)
444444
letadd(s:string)=(b.Append(s)|> ignore)
445445
letaddC(s:char)=(b.Append(s)|> ignore)
446-
add(aref.Name);
446+
add(aref.Name)
447447
match aref.Versionwith
448448
| None->()
449449
| Some(a, b, c, d)->
450-
add", Version=";
450+
add", Version="
451451
add(string(int a))
452-
add".";
452+
add"."
453453
add(string(int b))
454-
add".";
454+
add"."
455455
add(string(int c))
456-
add".";
456+
add"."
457457
add(string(int d))
458458
add", Culture="
459459
match aref.Localewith
@@ -482,13 +482,13 @@ type ILAssemblyRef(data) =
482482

483483
[<StructuralEquality; StructuralComparison>]
484484
typeILModuleRef=
485-
{ name:string;
486-
hasMetadata:bool;
487-
hash:byte[] option;}
485+
{ name:string
486+
hasMetadata:bool
487+
hash:byte[] option}
488488

489489
static memberCreate(name,hasMetadata,hash)=
490-
{ name=name;
491-
hasMetadata= hasMetadata;
490+
{ name=name
491+
hasMetadata= hasMetadata
492492
hash=hash}
493493

494494
memberx.Name=x.name
@@ -765,10 +765,12 @@ and [<RequireQualifiedAccess; StructuralEquality; StructuralComparison>]
765765
match xwith
766766
| ILType.TypeVar_->true|_->false
767767

768+
overridex.ToString()= x.QualifiedName
769+
768770
and [<StructuralEquality; StructuralComparison>]
769771
ILCallingSignature=
770-
{ CallingConv:ILCallingConv;
771-
ArgTypes:ILTypes;
772+
{ CallingConv:ILCallingConv
773+
ArgTypes:ILTypes
772774
ReturnType:ILType}
773775

774776
andILGenericArgs= list<ILType>
@@ -938,7 +940,9 @@ type ILAttributeNamedArg = (string * ILType * bool * ILAttribElem)
938940
typeILAttribute=
939941
{ Method:ILMethodSpec
940942
Data:byte[]
941-
Elements:ILAttribElem list}
943+
Elements:ILAttribElem list}
944+
945+
overridex.ToString()= x.Method.ToString()+"(...)"
942946

943947
[<NoEquality; NoComparison; Struct>]
944948
typeILAttributes(array: ILAttribute[])=
@@ -1190,20 +1194,20 @@ type ILCode =
11901194

11911195
[<RequireQualifiedAccess; NoComparison; NoEquality>]
11921196
typeILLocal=
1193-
{ Type:ILType;
1194-
IsPinned:bool;
1197+
{ Type:ILType
1198+
IsPinned:bool
11951199
DebugInfo:(string* int* int) option}
11961200

11971201
typeILLocals= list<ILLocal>
11981202

11991203
[<RequireQualifiedAccess; NoEquality; NoComparison>]
12001204
typeILMethodBody=
1201-
{ IsZeroInit:bool;
1202-
MaxStack:int32;
1203-
NoInlining:bool;
1204-
AggressiveInlining:bool;
1205-
Locals:ILLocals;
1206-
Code:ILCode;
1205+
{ IsZeroInit:bool
1206+
MaxStack:int32
1207+
NoInlining:bool
1208+
AggressiveInlining:bool
1209+
Locals:ILLocals
1210+
Code:ILCode
12071211
SourceMarker:ILSourceMarker option}
12081212

12091213
[<RequireQualifiedAccess>]
@@ -2673,16 +2677,16 @@ and rescopeILCallSig scoref csig =
26732677
mkILCallSig(csig.CallingConv, rescopeILTypes scoref csig.ArgTypes, rescopeILType scoref csig.ReturnType)
26742678

26752679
letrescopeILMethodRef scoref(x:ILMethodRef)=
2676-
{ mrefParent= rescopeILTypeRef scoref x.DeclaringTypeRef;
2677-
mrefCallconv= x.mrefCallconv;
2678-
mrefGenericArity=x.mrefGenericArity;
2679-
mrefName=x.mrefName;
2680-
mrefArgs= rescopeILTypes scoref x.mrefArgs;
2680+
{ mrefParent= rescopeILTypeRef scoref x.DeclaringTypeRef
2681+
mrefCallconv= x.mrefCallconv
2682+
mrefGenericArity=x.mrefGenericArity
2683+
mrefName=x.mrefName
2684+
mrefArgs= rescopeILTypes scoref x.mrefArgs
26812685
mrefReturn= rescopeILType scoref x.mrefReturn}
26822686

26832687
letrescopeILFieldRef scoref x=
2684-
{ DeclaringTypeRef= rescopeILTypeRef scoref x.DeclaringTypeRef;
2685-
Name= x.Name;
2688+
{ DeclaringTypeRef= rescopeILTypeRef scoref x.DeclaringTypeRef
2689+
Name= x.Name
26862690
Type= rescopeILType scoref x.Type}
26872691

26882692
// --------------------------------------------------------------------
@@ -2741,8 +2745,8 @@ let mkILReturn ty : ILReturn =
27412745
MetadataIndex= NoMetadataIdx}
27422746

27432747
letmkILLocal ty dbgInfo:ILLocal=
2744-
{ IsPinned=false;
2745-
Type=ty;
2748+
{ IsPinned=false
2749+
Type=ty
27462750
DebugInfo=dbgInfo}
27472751

27482752
typeILFieldSpecwith
@@ -2793,7 +2797,7 @@ let mkILCtor (access, args, impl) =
27932797
// --------------------------------------------------------------------
27942798

27952799
letmkCallBaseConstructor(typ,args:ILType list)=
2796-
[ mkLdarg0;]@
2800+
[ mkLdarg0]@
27972801
List.mapi(fun i _-> mkLdarg(uint16(i+1))) args@
27982802
[ mkNormalCall(mkILCtorMethSpecForTy(typ,[]))]
27992803

@@ -2985,7 +2989,7 @@ type ILLocalsAllocator(numPrealloc:int) =
29852989
letnewLocals= ResizeArray<ILLocal>()
29862990
membertmps.AllocLocal loc=
29872991
letlocn= uint16(numPrealloc+ newLocals.Count)
2988-
newLocals.Add loc;
2992+
newLocals.Add loc
29892993
locn
29902994

29912995
membertmps.Close()= ResizeArray.toList newLocals
@@ -3051,9 +3055,9 @@ let mkILStorageCtorWithParamNames(tag, preblock, typ, extraParams, flds, access)
30513055
(match tagwith Some x->[I_seqpoint x]| None->[])@
30523056
preblock@
30533057
List.concat(List.mapi(fun n(_pnm,nm,ty)->
3054-
[ mkLdarg0;
3055-
mkLdarg(uint16(n+1));
3056-
mkNormalStfld(mkILFieldSpecInTy(typ, nm, ty));
3058+
[ mkLdarg0
3059+
mkLdarg(uint16(n+1))
3060+
mkNormalStfld(mkILFieldSpecInTy(typ, nm, ty))
30573061
]) flds)
30583062
end, tag))
30593063

@@ -3062,7 +3066,7 @@ let mkILSimpleStorageCtorWithParamNames(tag, base_tspec, typ, extraParams, flds,
30623066
match base_tspecwith
30633067
None->[]
30643068
| Some tspec->
3065-
([ mkLdarg0;
3069+
([ mkLdarg0
30663070
mkNormalCall(mkILCtorMethSpecForTy(mkILBoxedType tspec,[]))])
30673071
mkILStorageCtorWithParamNames(tag, preblock, typ, extraParams, flds, access)
30683072

@@ -3190,26 +3194,26 @@ let mkILDelegateMethods (access) (ilg: ILGlobals) (iltyp_AsyncCallback, iltyp_IA
31903194
mdef.WithAbstract(false).WithHideBySig(true).WithRuntime(true)
31913195
letctor= mkILCtor(access,[ mkILParamNamed("object", ilg.typ_Object); mkILParamNamed("method", ilg.typ_IntPtr)], MethodBody.Abstract)
31923196
letctor= ctor.WithRuntime(true).WithHideBySig(true)
3193-
[ ctor;
3194-
one"Invoke" parms rty;
3195-
one"BeginInvoke"(parms@[mkILParamNamed("callback", iltyp_AsyncCallback); mkILParamNamed("objects", ilg.typ_Object)]) iltyp_IAsyncResult;
3196-
one"EndInvoke"[mkILParamNamed("result", iltyp_IAsyncResult)] rty;]
3197+
[ ctor
3198+
one"Invoke" parms rty
3199+
one"BeginInvoke"(parms@[mkILParamNamed("callback", iltyp_AsyncCallback); mkILParamNamed("objects", ilg.typ_Object)]) iltyp_IAsyncResult
3200+
one"EndInvoke"[mkILParamNamed("result", iltyp_IAsyncResult)] rty]
31973201

31983202

31993203
letmkCtorMethSpecForDelegate(ilg:ILGlobals)(typ:ILType,useUIntPtr)=
32003204
letscoref= typ.TypeRef.Scope
32013205
mkILInstanceMethSpecInTy(typ,".ctor",[rescopeILType scoref ilg.typ_Object; rescopeILType scoref(if useUIntPtrthen ilg.typ_UIntPtrelse ilg.typ_IntPtr)], ILType.Void, emptyILGenericArgsList)
32023206

32033207
typeILEnumInfo=
3204-
{ enumValues:(string* ILFieldInit) list;
3208+
{ enumValues:(string* ILFieldInit) list
32053209
enumType:ILType}
32063210

32073211
letgetTyOfILEnumInfo info= info.enumType
32083212

32093213
letcomputeILEnumInfo(mdName,mdFields:ILFieldDefs)=
32103214
match(List.partition(fun(fd:ILFieldDef)-> fd.IsStatic) mdFields.AsList)with
32113215
| staticFields,[vfd]->
3212-
{ enumType= vfd.FieldType;
3216+
{ enumType= vfd.FieldType
32133217
enumValues= staticFields|> List.map(fun fd->(fd.Name,match fd.LiteralValuewith Some i-> i| None-> failwith("info_of_enum_tdef: badly formed enum"+mdName+": static field does not have an default value")))}
32143218
|_,[]-> failwith("info_of_enum_tdef: badly formed enum"+mdName+": no non-static field found")
32153219
|_,_-> failwith("info_of_enum_tdef: badly formed enum"+mdName+": more than one non-static field found")
@@ -3336,9 +3340,9 @@ let z_unsigned_int_size n =
33363340
letz_unsigned_int n=
33373341
if n>=0&& n<=0x7Fthen[| byte n|]
33383342
elif n>=0x80&& n<=0x3FFFthen[| byte(0x80|||(n>>>&8)); byte(n&&&0xFF)|]
3339-
else[| byte(0xc0|||(n>>>&24));
3340-
byte((n>>>&16)&&&0xFF);
3341-
byte((n>>>&8)&&&0xFF);
3343+
else[| byte(0xc0|||(n>>>&24))
3344+
byte((n>>>&16)&&&0xFF)
3345+
byte((n>>>&8)&&&0xFF)
33423346
byte(n&&&0xFF)|]
33433347

33443348
letstring_as_utf8_bytes(s:string)= System.Text.Encoding.UTF8.GetBytes s
@@ -3513,8 +3517,8 @@ and encodeCustomAttrValue ilg ty c =
35133517

35143518
letencodeCustomAttrNamedArg ilg(nm,ty,prop,elem)=
35153519
[|yield(if propthen0x54uyelse0x53uy)
3516-
yield! encodeCustomAttrElemType ty;
3517-
yield! encodeCustomAttrString nm;
3520+
yield! encodeCustomAttrElemType ty
3521+
yield! encodeCustomAttrString nm
35183522
yield! encodeCustomAttrValue ilg ty elem|]
35193523

35203524
letmkILCustomAttribMethRef(ilg:ILGlobals)(mspec:ILMethodSpec,fixedArgs:list<_>,namedArgs:list<_>)=
@@ -3526,8 +3530,8 @@ let mkILCustomAttribMethRef (ilg: ILGlobals) (mspec:ILMethodSpec, fixedArgs: lis
35263530
yield! u16AsBytes(uint16 namedArgs.Length)
35273531
for namedArgin namedArgsdo
35283532
yield! encodeCustomAttrNamedArg ilg namedArg|]
3529-
{ Method= mspec;
3530-
Data= args;
3533+
{ Method= mspec
3534+
Data= args
35313535
Elements= fixedArgs@(namedArgs|> List.map(fun(_,_,_,e)-> e))}
35323536

35333537
letmkILCustomAttribute ilg(tref,argtys,argvs,propvs)=
@@ -3547,15 +3551,15 @@ let EcmaMscorlibILGlobals = mkILGlobals MscorlibScopeRef
35473551
// in §23.3, beginning with NumNamed).
35483552
letmkPermissionSet(ilg:ILGlobals)(action,attributes:list<(ILTypeRef*(string* ILType* ILAttribElem) list)>)=
35493553
letbytes=
3550-
[|yield(byte'.');
3551-
yield! z_unsigned_int attributes.Length;
3554+
[|yield(byte'.')
3555+
yield! z_unsigned_int attributes.Length
35523556
for(tref:ILTypeRef, props)in attributesdo
35533557
yield! encodeCustomAttrString tref.QualifiedName
35543558
letbytes=
3555-
[|yield! z_unsigned_int props.Length;
3556-
for(nm, typ, value)in propsdo
3557-
yield! encodeCustomAttrNamedArg ilg(nm, typ,true, value)|]
3558-
yield! z_unsigned_int bytes.Length;
3559+
[|yield! z_unsigned_int props.Length
3560+
for(nm, typ, value)in propsdo
3561+
yield! encodeCustomAttrNamedArg ilg(nm, typ,true, value)|]
3562+
yield! z_unsigned_int bytes.Length
35593563
yield! bytes|]
35603564

35613565
ILSecurityDecl.ILSecurityDecl(action, bytes)
@@ -3704,7 +3708,7 @@ let decodeILAttribData (ilg: ILGlobals) (ca: ILAttribute) =
37043708
letsigptr=0
37053709
letbb0,sigptr= sigptr_get_byte bytes sigptr
37063710
letbb1,sigptr= sigptr_get_byte bytes sigptr
3707-
ifnot(bb0=0x01&& bb1=0x00)then failwith"decodeILAttribData: invalid data";
3711+
ifnot(bb0=0x01&& bb1=0x00)then failwith"decodeILAttribData: invalid data"
37083712

37093713
let recparseVal argty sigptr=
37103714
match argtywith
@@ -3825,16 +3829,16 @@ let decodeILAttribData (ilg: ILGlobals) (ca: ILAttribute) =
38253829
// --------------------------------------------------------------------
38263830

38273831
typeILReferences=
3828-
{ AssemblyReferences:ILAssemblyRef list;
3829-
ModuleReferences:ILModuleRef list;}
3832+
{ AssemblyReferences:ILAssemblyRef list
3833+
ModuleReferences:ILModuleRef list}
38303834

38313835
typeILReferencesAccumulator=
3832-
{ refsA:HashSet<ILAssemblyRef>;
3833-
refsM:HashSet<ILModuleRef>;}
3836+
{ refsA:HashSet<ILAssemblyRef>
3837+
refsM:HashSet<ILModuleRef>}
38343838

38353839
letemptyILRefs=
3836-
{ AssemblyReferences=[];
3837-
ModuleReferences=[];}
3840+
{ AssemblyReferences=[]
3841+
ModuleReferences=[]}
38383842

38393843
(* Now find references.*)
38403844
letrefs_of_assref(s:ILReferencesAccumulator)x= s.refsA.Add x|> ignore
@@ -3866,19 +3870,19 @@ and refs_of_genparams s b = List.iter (refs_of_genparam s) b
38663870
andrefs_of_dloc s ts= refs_of_tref s ts
38673871

38683872
andrefs_of_mref s(x:ILMethodRef)=
3869-
refs_of_dloc s x.DeclaringTypeRef;
3870-
refs_of_typs s x.mrefArgs;
3873+
refs_of_dloc s x.DeclaringTypeRef
3874+
refs_of_typs s x.mrefArgs
38713875
refs_of_typ s x.mrefReturn
38723876

38733877
andrefs_of_fref s x= refs_of_tref s x.DeclaringTypeRef; refs_of_typ s x.Type
38743878
andrefs_of_ospec s(OverridesSpec(mref,ty))= refs_of_mref s mref; refs_of_typ s ty
38753879
andrefs_of_mspec s(x:ILMethodSpec)=
3876-
refs_of_mref s x.MethodRef;
3877-
refs_of_typ s x.DeclaringType;
3880+
refs_of_mref s x.MethodRef
3881+
refs_of_typ s x.DeclaringType
38783882
refs_of_inst s x.GenericArgs
38793883

38803884
andrefs_of_fspec s x=
3881-
refs_of_fref s x.FieldRef;
3885+
refs_of_fref s x.FieldRef
38823886
refs_of_typ s x.DeclaringType
38833887

38843888
andrefs_of_typs s l= List.iter(refs_of_typ s) l
@@ -3896,11 +3900,11 @@ and refs_of_varargs s tyso = Option.iter (refs_of_typs s) tyso
38963900
andrefs_of_instr s x=
38973901
match xwith
38983902
| I_call(_, mr, varargs)| I_newobj(mr, varargs)| I_callvirt(_, mr, varargs)->
3899-
refs_of_mspec s mr;
3903+
refs_of_mspec s mr
39003904
refs_of_varargs s varargs
39013905
| I_callconstraint(_, tr, mr, varargs)->
3902-
refs_of_typ s tr;
3903-
refs_of_mspec s mr;
3906+
refs_of_typ s tr
3907+
refs_of_mspec s mr
39043908
refs_of_varargs s varargs
39053909
| I_calli(_, callsig, varargs)->
39063910
refs_of_callsig s callsig; refs_of_varargs s varargs

‎src/buildfromsource/FSharp.Compiler.Private/FSComp.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ type internal SR private() =
363363
static membertastUnexpectedByRef()=(255, GetStringFunc("tastUnexpectedByRef",",,,"))
364364
/// A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...'
365365
/// (Originally from ..\FSComp.txt:86)
366-
static membertastValueMustBeLocalAndMutable()=(256, GetStringFunc("tastValueMustBeLocalAndMutable",",,,"))
366+
static membertastValueMustBeMutable()=(256, GetStringFunc("tastValueMustBeMutable",",,,"))
367367
/// Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'.
368368
/// (Originally from ..\FSComp.txt:87)
369369
static membertastInvalidMutationOfConstant()=(257, GetStringFunc("tastInvalidMutationOfConstant",",,,"))
@@ -4394,7 +4394,7 @@ type internal SR private() =
43944394
ignore(GetString("tastInvalidFormForPropertyGetter"))
43954395
ignore(GetString("tastInvalidFormForPropertySetter"))
43964396
ignore(GetString("tastUnexpectedByRef"))
4397-
ignore(GetString("tastValueMustBeLocalAndMutable"))
4397+
ignore(GetString("tastValueMustBeMutable"))
43984398
ignore(GetString("tastInvalidMutationOfConstant"))
43994399
ignore(GetString("tastValueHasBeenCopied"))
44004400
ignore(GetString("tastRecursiveValuesMayNotBeInConstructionOfTuple"))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp