Skip to content

Commit cb106cf

Browse files
authored
Remove unused code (#14589)
* Remove unused code.
1 parent a053e8e commit cb106cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+16
-1412
lines changed

src/Compiler/AbstractIL/il.fs

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ let _ =
2929
if logging then
3030
dprintn "* warning: Il.logging is on"
3131

32-
let int_order = LanguagePrimitives.FastGenericComparer<int>
33-
3432
let notlazy v = Lazy<_>.CreateFromValue v
3533

3634
/// A little ugly, but the idea is that if a data structure does not
@@ -99,8 +97,6 @@ let rec splitNamespaceAux (nm: string) =
9997
let splitNamespace nm =
10098
memoizeNamespaceTable.GetOrAdd(nm, splitNamespaceAux)
10199

102-
let splitNamespaceMemoized nm = splitNamespace nm
103-
104100
// ++GLOBAL MUTABLE STATE (concurrency-safe)
105101
let memoizeNamespaceArrayTable = ConcurrentDictionary<string, string[]>()
106102

@@ -152,11 +148,6 @@ splitILTypeNameWithPossibleStaticArguments "Foo.Bar,\"1.0\"" = ([| "Foo" |], "Ba
152148
splitILTypeNameWithPossibleStaticArguments "Foo.Bar.Bar,\"1.0\"" = ([| "Foo"; "Bar" |], "Bar,\"1.0\"")
153149
*)
154150

155-
let unsplitTypeName (ns, n) =
156-
match ns with
157-
| [] -> String.concat "." ns + "." + n
158-
| _ -> n
159-
160151
let splitTypeNameRightAux (nm: string) =
161152
let idx = nm.LastIndexOf '.'
162153

@@ -434,8 +425,6 @@ type AssemblyRefData =
434425
/// Global state: table of all assembly references keyed by AssemblyRefData.
435426
let AssemblyRefUniqueStampGenerator = UniqueStampGenerator<AssemblyRefData>()
436427

437-
let isMscorlib data = data.assemRefName = "mscorlib"
438-
439428
[<Sealed>]
440429
type ILAssemblyRef(data) =
441430
let pkToken key =
@@ -3249,9 +3238,6 @@ let mkILMethods xs =
32493238
let mkILMethodsComputed f = ILMethodDefs f
32503239
let emptyILMethods = mkILMethodsFromArray [||]
32513240

3252-
let filterILMethodDefs f (mdefs: ILMethodDefs) =
3253-
ILMethodDefs(fun () -> mdefs.AsArray() |> Array.filter f)
3254-
32553241
// --------------------------------------------------------------------
32563242
// Operations and defaults for modules, assemblies etc.
32573243
// --------------------------------------------------------------------
@@ -3460,11 +3446,6 @@ let mkLdcInt32 i =
34603446
else
34613447
AI_ldc(DT_I4, ILConst.I4 i)
34623448

3463-
let tname_CompilerGeneratedAttribute =
3464-
"System.Runtime.CompilerServices.CompilerGeneratedAttribute"
3465-
3466-
let tname_DebuggableAttribute = "System.Diagnostics.DebuggableAttribute"
3467-
34683449
(* NOTE: ecma_ prefix refers to the standard "mscorlib" *)
34693450
let ecmaPublicKey =
34703451
PublicKeyToken(Bytes.ofInt32Array [| 0xde; 0xad; 0xbe; 0xef; 0xca; 0xfe; 0xfa; 0xce |])
@@ -3819,14 +3800,6 @@ let mkILClassCtor impl =
38193800
body = notlazy impl
38203801
)
38213802

3822-
// --------------------------------------------------------------------
3823-
// Make a virtual method, where the overriding is simply the default
3824-
// (i.e. overrides by name/signature)
3825-
// --------------------------------------------------------------------
3826-
3827-
let mk_ospec (ty: ILType, callconv, nm, genparams, formal_args, formal_ret) =
3828-
OverridesSpec(mkILMethRef (ty.TypeRef, callconv, nm, genparams, formal_args, formal_ret), ty)
3829-
38303803
let mkILGenericVirtualMethod (nm, callconv: ILCallingConv, access, genparams, actual_args, actual_ret, impl) =
38313804
let attributes =
38323805
convertMemberAccess access
@@ -3953,11 +3926,6 @@ let cdef_cctorCode2CodeOrCreate tag imports f (cd: ILTypeDef) =
39533926

39543927
cd.With(methods = methods)
39553928

3956-
let codeOfMethodDef (md: ILMethodDef) =
3957-
match md.Code with
3958-
| Some x -> x
3959-
| None -> failwith "codeOfmdef: not IL"
3960-
39613929
let mkRefToILMethod (tref, md: ILMethodDef) =
39623930
mkILMethRef (tref, md.CallingConv, md.Name, md.GenericParams.Length, md.ParameterTypes, md.Return.Type)
39633931

@@ -4363,10 +4331,6 @@ let computeILEnumInfo (mdName, mdFields: ILFieldDefs) =
43634331

43644332
let sigptr_get_byte bytes sigptr = Bytes.get bytes sigptr, sigptr + 1
43654333

4366-
let sigptr_get_bool bytes sigptr =
4367-
let b0, sigptr = sigptr_get_byte bytes sigptr
4368-
(b0 = 0x01), sigptr
4369-
43704334
let sigptr_get_u8 bytes sigptr =
43714335
let b0, sigptr = sigptr_get_byte bytes sigptr
43724336
byte b0, sigptr
@@ -4490,11 +4454,6 @@ let mkRefToILAssembly (m: ILAssemblyManifest) =
44904454
m.Locale
44914455
)
44924456

4493-
let z_unsigned_int_size n =
4494-
if n <= 0x7F then 1
4495-
elif n <= 0x3FFF then 2
4496-
else 3
4497-
44984457
let z_unsigned_int n =
44994458
if n >= 0 && n <= 0x7F then
45004459
[| byte n |]
@@ -4555,8 +4514,6 @@ let ieee32AsBytes i = i32AsBytes (bitsOfSingle i)
45554514

45564515
let ieee64AsBytes i = i64AsBytes (bitsOfDouble i)
45574516

4558-
let et_END = 0x00uy
4559-
let et_VOID = 0x01uy
45604517
let et_BOOLEAN = 0x02uy
45614518
let et_CHAR = 0x03uy
45624519
let et_I1 = 0x04uy
@@ -4570,22 +4527,8 @@ let et_U8 = 0x0Buy
45704527
let et_R4 = 0x0Cuy
45714528
let et_R8 = 0x0Duy
45724529
let et_STRING = 0x0Euy
4573-
let et_PTR = 0x0Fuy
4574-
let et_BYREF = 0x10uy
4575-
let et_VALUETYPE = 0x11uy
4576-
let et_CLASS = 0x12uy
4577-
let et_VAR = 0x13uy
4578-
let et_ARRAY = 0x14uy
4579-
let et_WITH = 0x15uy
4580-
let et_TYPEDBYREF = 0x16uy
4581-
let et_I = 0x18uy
4582-
let et_U = 0x19uy
4583-
let et_FNPTR = 0x1Buy
45844530
let et_OBJECT = 0x1Cuy
45854531
let et_SZARRAY = 0x1Duy
4586-
let et_MVAR = 0x1Euy
4587-
let et_CMOD_REQD = 0x1Fuy
4588-
let et_CMOD_OPT = 0x20uy
45894532

45904533
let formatILVersion (version: ILVersionInfo) =
45914534
sprintf "%d.%d.%d.%d" (int version.Major) (int version.Minor) (int version.Build) (int version.Revision)

src/Compiler/AbstractIL/ilmorph.fs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ and callsig_scoref2scoref_tyvar2ty f x =
112112
and tys_scoref2scoref_tyvar2ty f i =
113113
List.map (ty_scoref2scoref_tyvar2ty f) i
114114

115-
and gparams_scoref2scoref_tyvar2ty f i =
116-
List.map (gparam_scoref2scoref_tyvar2ty f) i
117-
118-
and gparam_scoref2scoref_tyvar2ty _f i = i
119-
120115
and morphILScopeRefsInILTypeRef fscope (tref: ILTypeRef) =
121116
ILTypeRef.Create(scope = fscope tref.Scope, enclosing = tref.Enclosing, name = tref.Name)
122117

src/Compiler/AbstractIL/ilnativeres.fs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ type WCHAR = Char
2626
type WORD = uint16
2727

2828
let inline WORD s = uint16 s
29-
let inline DWORD s = uint32 s
30-
let inline WCHAR s = char s
31-
let inline BYTE s = byte s
3229

3330
type ResourceException(name: string, ?inner: Exception MaybeNull) =
3431
inherit Exception(name, Option.toObj inner)

0 commit comments

Comments
 (0)