diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config
index e20fd46714b..2210fd599b7 100644
--- a/.nuget/NuGet.Config
+++ b/.nuget/NuGet.Config
@@ -11,6 +11,7 @@
+
diff --git a/README.md b/README.md
index 0544d82226c..5ab31fce7c9 100644
--- a/README.md
+++ b/README.md
@@ -37,14 +37,6 @@ Quickstart guides for build and test can be found [here](https://github.com/Micr
####Development tools
-For F# 4.0 development
-
-- [Visual Studio 2015](http://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs)
- - Select Visual C++ / Common Tools For Visual C++
- - Visual F#
- - Visual Studio Extensibility Tools
-- [Visual Studio 2015 SDK](http://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs)
-
For F# 4.1 development
- [Visual Studio 15](https://www.visualstudio.com/en-us/downloads/visual-studio-next-downloads-vs.aspx)
diff --git a/TESTGUIDE.md b/TESTGUIDE.md
index ec4446e54dd..0cedeb9f348 100644
--- a/TESTGUIDE.md
+++ b/TESTGUIDE.md
@@ -48,7 +48,7 @@ The F# tests are split as follows:
### FSharp Suite
-This is now compiled using [tests\fsharp\FSharp.Tests.fsproj] to a unit test DLL which acts as a driver script.
+This is now compiled using [tests\fsharp\FSharp.Tests.fsproj](tests/fsharp/FSharp.Tests.fsproj) to a unit test DLL which acts as a driver script.
This compiles and executes the `test.fsx` file using some combination of compiler or FSI flags.
If the compilation and execution encounter no errors, the test is considered to have passed.
diff --git a/UpgradeLog.htm b/UpgradeLog.htm
deleted file mode 100644
index 513006fe059..00000000000
Binary files a/UpgradeLog.htm and /dev/null differ
diff --git a/build.cmd b/build.cmd
index 9e856ae7a55..efea207cf0c 100644
--- a/build.cmd
+++ b/build.cmd
@@ -96,6 +96,7 @@ if /i '%ARG%' == 'all' (
set BUILD_CORECLR=1
set BUILD_PORTABLE=1
set BUILD_VS=1
+ set BUILD_SETUP=1
set TEST_COMPILERUNIT=1
set TEST_NET40_COREUNIT=1
@@ -142,6 +143,7 @@ if /i '%ARG%' == 'ci' (
set BUILD_CORECLR=1
set BUILD_PORTABLE=1
set BUILD_VS=1
+ set BUILD_SETUP=1
set TEST_COMPILERUNIT=1
set TEST_NET40_COREUNIT=1
@@ -162,6 +164,7 @@ if /i '%ARG%' == 'ci_part1' (
set BUILD_CORECLR=0
set BUILD_PORTABLE=1
set BUILD_VS=1
+ set BUILD_SETUP=1
set TEST_COMPILERUNIT=1
set TEST_NET40_COREUNIT=0
@@ -418,14 +421,12 @@ call BuildTestTools.cmd %BUILD_CONFIG_LOWERCASE%
@echo on
if '%TEST_FSHARP_SUITE%' == '1' (
- set FSHARP_TEST_SUITE_USE_NUNIT_RUNNER=true
call RunTests.cmd %BUILD_CONFIG_LOWERCASE% fsharp %TEST_TAGS%
@if ERRORLEVEL 1 (
type testresults\FSharpNunit_Error.log
echo Error: 'RunTests.cmd %BUILD_CONFIG_LOWERCASE% fsharp %TEST_TAGS%' failed
goto :failed_tests
)
- set FSHARP_TEST_SUITE_USE_NUNIT_RUNNER=
)
if '%TEST_FSHARPQA_SUITE%' == '1' (
diff --git a/packages.config b/packages.config
index 6082805e2d3..5d2b3e4e9d1 100644
--- a/packages.config
+++ b/packages.config
@@ -13,6 +13,8 @@
+
+
diff --git a/setup/FSharp.SDK/FSharp.SDK.wixproj b/setup/FSharp.SDK/FSharp.SDK.wixproj
index 12843effde0..d6d6d55da57 100644
--- a/setup/FSharp.SDK/FSharp.SDK.wixproj
+++ b/setup/FSharp.SDK/FSharp.SDK.wixproj
@@ -72,7 +72,7 @@
-
+
diff --git a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs
index 7aeee352462..06a72ffd2f4 100644
--- a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs
+++ b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs
@@ -29,6 +29,7 @@
+
@@ -161,6 +162,10 @@
+
+
+
+
diff --git a/setup/FSharp.Setup.props b/setup/FSharp.Setup.props
index 0ead30f9770..17ec131f3a6 100644
--- a/setup/FSharp.Setup.props
+++ b/setup/FSharp.Setup.props
@@ -4,12 +4,20 @@
2.03.10
- 4.13.10.0.1503$(SetupRootFolder)\..\packages\WiX.Toolset.2015.$(WiXToolset2015Version)\tools\wix$(SetupRootFolder)\..\packages
-
+
+
+ 4.1
+
+ $([System.DateTime]::Now.ToString(yyyyMMdd.0))
+
+ $(FSharpProductVersion).$(BUILD_BUILDNUMBER.Replace(".DRAFT", ""))
+
+
+
net40Debug
diff --git a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Desktop.Templates.swr b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Desktop.Templates.swr
index f918abc7334..cb2456154b7 100644
--- a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Desktop.Templates.swr
+++ b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Desktop.Templates.swr
@@ -10,6 +10,7 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplate
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\ConsoleProject\ConsoleApplication.fsproj"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\ConsoleProject\ConsoleApplication.vstemplate"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\ConsoleProject\Program.fs"
+ file source="$(BinariesFolder)\net40\bin\ProjectTemplates\ConsoleProject\packages.config"
folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplates\FSharp\$(LocaleId)\LibraryProject"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\LibraryProject\AssemblyInfo.fs"
@@ -17,8 +18,10 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplate
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\LibraryProject\Library.vstemplate"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\LibraryProject\Library1.fs"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\LibraryProject\Script.fsx"
+ file source="$(BinariesFolder)\net40\bin\ProjectTemplates\LibraryProject\packages.config"
folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplates\FSharp\$(LocaleId)\TutorialProject"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\TutorialProject\Tutorial.fsproj"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\TutorialProject\Tutorial.fsx"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\TutorialProject\Tutorial.vstemplate"
+ file source="$(BinariesFolder)\net40\bin\ProjectTemplates\TutorialProject\packages.config"
diff --git a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Full.Templates.swr b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Full.Templates.swr
index fec68497438..f8a4354bd51 100644
--- a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Full.Templates.swr
+++ b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Full.Templates.swr
@@ -10,6 +10,7 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplate
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\ConsoleProject\ConsoleApplication.fsproj"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\ConsoleProject\ConsoleApplication.vstemplate"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\ConsoleProject\Program.fs"
+ file source="$(BinariesFolder)\net40\bin\ProjectTemplates\ConsoleProject\packages.config"
folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplates\FSharp\$(LocaleId)\LibraryProject"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\LibraryProject\AssemblyInfo.fs"
@@ -17,6 +18,7 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplate
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\LibraryProject\Library.vstemplate"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\LibraryProject\Library1.fs"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\LibraryProject\Script.fsx"
+ file source="$(BinariesFolder)\net40\bin\ProjectTemplates\LibraryProject\packages.config"
folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplates\FSharp\$(LocaleId)\NetCore259Project"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\NetCore259Project\AssemblyInfo.fs"
@@ -24,6 +26,7 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplate
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\NetCore259Project\PortableLibrary.fsproj"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\NetCore259Project\PortableLibrary1.fs"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\NetCore259Project\Script.fsx"
+ file source="$(BinariesFolder)\net40\bin\ProjectTemplates\NetCore259Project\packages.config"
folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplates\FSharp\$(LocaleId)\NetCore78Project"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\NetCore78Project\AssemblyInfo.fs"
@@ -31,6 +34,7 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplate
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\NetCore78Project\PortableLibrary.fsproj"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\NetCore78Project\PortableLibrary1.fs"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\NetCore78Project\Script.fsx"
+ file source="$(BinariesFolder)\net40\bin\ProjectTemplates\NetCore78Project\packages.config"
folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplates\FSharp\$(LocaleId)\NetCoreProject"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\NetCoreProject\AssemblyInfo.fs"
@@ -38,6 +42,7 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplate
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\NetCoreProject\PortableLibrary.fsproj"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\NetCoreProject\PortableLibrary1.fs"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\NetCoreProject\Script.fsx"
+ file source="$(BinariesFolder)\net40\bin\ProjectTemplates\NetCoreProject\packages.config"
folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplates\FSharp\$(LocaleId)\PortableLibraryProject"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\PortableLibraryProject\AssemblyInfo.fs"
@@ -45,8 +50,10 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplate
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\PortableLibraryProject\PortableLibrary.vstemplate"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\PortableLibraryProject\PortableLibrary1.fs"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\PortableLibraryProject\Script.fsx"
+ file source="$(BinariesFolder)\net40\bin\ProjectTemplates\PortableLibraryProject\packages.config"
folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplates\FSharp\$(LocaleId)\TutorialProject"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\TutorialProject\Tutorial.fsproj"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\TutorialProject\Tutorial.fsx"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\TutorialProject\Tutorial.vstemplate"
+ file source="$(BinariesFolder)\net40\bin\ProjectTemplates\TutorialProject\packages.config"
diff --git a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Web.Templates.swr b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Web.Templates.swr
index 8f0cdd660ef..850c5e20e51 100644
--- a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Web.Templates.swr
+++ b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Web.Templates.swr
@@ -10,8 +10,10 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplate
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\LibraryProject\Library.vstemplate"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\LibraryProject\Library1.fs"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\LibraryProject\Script.fsx"
+ file source="$(BinariesFolder)\net40\bin\ProjectTemplates\LibraryProject\packages.config"
folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\ProjectTemplates\FSharp\$(LocaleId)\TutorialProject"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\TutorialProject\Tutorial.fsproj"
file source="$(BinariesFolder)\net40\bin\localize\$(LocaleCode)\ProjectTemplates\TutorialProject\Tutorial.fsx"
file source="$(BinariesFolder)\net40\bin\ProjectTemplates\TutorialProject\Tutorial.vstemplate"
+ file source="$(BinariesFolder)\net40\bin\ProjectTemplates\TutorialProject\packages.config"
diff --git a/src/absil/il.fs b/src/absil/il.fs
index 3d8f458ad8f..eae0b6d5cf0 100755
--- a/src/absil/il.fs
+++ b/src/absil/il.fs
@@ -287,115 +287,6 @@ module SHA1 =
let sha1HashBytes s = SHA1.sha1HashBytes s
-// --------------------------------------------------------------------
-// ILList
-// --------------------------------------------------------------------
-
-/// ILList is the type used to store relatively small lists in the Abstract IL data structures,
-/// i.e. for ILTypes, ILGenericArgs, ILParameters and ILLocals.
-
-// This #if starts isolating the representation for "ILTypes", "ILGenericArgs", "ILParameters" and "ILLocals"
-// with the aim of making it possible to easily switch between using arrays and lists as representations for these.
-// THis is because many allocations of these small lists appear in memory logs.
-//
-// The "obviouos" step is to use arrays instead of lists. However, this is routinely and surprisingly disappointing.
-// As a result, we haven't enabled the use of arrays: we had expected this change to give a perf gain,
-// but it does not! It even gives a small perf loss. We've tried this approach on several other occasions
-// for other data structures and each time been surprised that there's no perf gain. It's possible that
-// arrays-of-references are just not as fast as we expect here: either the runtime check on assignment
-// into the array, or some kind of write barrier may be degrading performance.
-//
-// However, There must surely be some better data structure here than allocating endless linked-list containing one item
-// each. One option is to use a linked-list structure that stores multiple elements in each allocation, e.g.
-//
-// type ThreeList<'T> = T of 'T * 'T * 'T * ThreeList<'T>
-//
-// and a similar hack is used as the underlying representation fot List<'T>, where we store a "constant" value to indicate the end
-// of the sequence. Some of the 'T values would be empty to indicate a partially-filled node. Storing an integer would of course
-// make things clearer, and allow values-with-null to be stored in the data structure:
-//
-// type ThreeList<'T> = T of int * 'T * 'T * 'T * ThreeList<'T>
-//
-// Since we haven't quite given up on moving away from lists as yet, the #if below still feels useful
-// as it isolates the representation of these data structures from the rest of the compiler.
-//
-// Note this is similar to the use of "Flat Lists" in the tast.fs data structures where we tried to eliminate
-// the use of lists in the tast.fs nodes of the compiler, but that also didn't give perf gains.
-//
-// If it turns out that we just eventually completely abandon these exercises then we can eliminate this code and
-// universally replace "ILList" and "FlatList" by "List".
-
-#if ABSIL_USES_ARRAY_FOR_ILLIST
-type ILList<'T> = 'T[]
-[]
-module ILList =
- let inline map f x = Array.map f x
- let inline mapi f x = Array.mapi f x
- let inline isEmpty (x:ILList<_>) = x.Length <> 0
- let inline toArray (x:ILList<_>) = x
- let inline ofArray (x:'T[]) = x
- []
- let inline nth n (x:'T[]) = x.[n]
- let inline item n (x:'T[]) = x.[n]
- let inline toList (x:ILList<_>) = Array.toList x
- let inline ofList (x:'T list) = Array.ofList x
- let inline lengthsEqAndForall2 f x1 x2 = Array.lengthsEqAndForall2 f x1 x2
- let inline init n f = Array.init n f
- let inline empty<'T> = ([| |] :'T[])
- let inline iter f (x:'T[]) = Array.iter f x
- let inline iteri f (x:'T[]) = Array.iteri f x
- let inline foldBack f (x:'T[]) z = Array.foldBack f x z
- let inline exists f x = Array.exists f x
-#endif
-
-//#if ABSIL_USES_LIST_FOR_ILLIST
-type ILList<'T> = 'T list
-
-[]
-module ILList =
- let inline map f x = List.map f x
- let inline mapi f x = List.mapi f x
- let inline isEmpty x = match x with [] -> true | _ -> false
- let inline toArray (x:ILList<_>) = List.toArray x
- let inline ofArray (x:'T[]) = List.ofArray x
- let inline iter f (x:'T list) = List.iter f x
- let inline iteri f (x:'T list) = List.iteri f x
- []
- let inline nth (x:'T list) n = List.item n x
- let inline item n (x:'T list) = List.item n x
- let inline toList (x:ILList<_>) = x
- let inline ofList (x:'T list) = x
- let inline lengthsEqAndForall2 f x1 x2 = List.lengthsEqAndForall2 f x1 x2
- let inline init n f = List.init n f
- let inline empty<'T> = ([ ] :'T list)
- let inline foldBack f x z = List.foldBack f x z
- let inline exists f x = List.exists f x
-//#endif // ABSIL_USES_LIST_FOR_ILLIST
-
-#if ABSIL_USES_THREELIST_FOR_ILLIST
-type ILList<'T> = ThreeList<'T>
-
-[]
-module ILList =
- let inline map f x = ThreeList.map f x
- let inline mapi f x = ThreeList.mapi f x
- let inline isEmpty x = ThreeList.isEmpty x
- let inline toArray (x:ILList<_>) = ThreeList.toArray x
- let inline ofArray (x:'T[]) = ThreeList.ofArray x
- let inline iter f (x:ILList<'T>) = ThreeList.iter f x
- let inline iteri f (x:ILList<'T>) = ThreeList.iteri f x
- let inline toList (x:ILList<_>) = ThreeList.toList x
- []
- let inline nth (x:ILList<'T>) n = ThreeList.nth x n
- let inline item n (x:ILList<'T>) = ThreeList.nth n x
- let inline ofList (x:'T list) = ThreeList.ofList x
- let inline lengthsEqAndForall2 f x1 x2 = ThreeList.lengthsEqAndForall2 f x1 x2
- let inline init n f = ThreeList.init n f
- let inline empty<'T> = ThreeList.empty<'T>
- let inline foldBack f x z = ThreeList.foldBack f x z
- let inline exists f x = ThreeList.exists f x
-#endif
-
// --------------------------------------------------------------------
//
// --------------------------------------------------------------------
@@ -665,7 +556,7 @@ type ILTypeRef =
member x.ApproxId = x.hashCode
member x.AsBoxedType (tspec:ILTypeSpec) =
- match tspec.tspecInst.Length with
+ match List.length tspec.tspecInst with
| 0 ->
let v = x.asBoxedType
match box v with
@@ -727,13 +618,13 @@ and
member x.Name=x.TypeRef.Name
member x.GenericArgs=x.tspecInst
static member Create(tref,inst) = { tspecTypeRef =tref; tspecInst=inst }
- override x.ToString() = x.TypeRef.ToString() + (if ILList.isEmpty x.GenericArgs then "" else "<...>")
+ override x.ToString() = x.TypeRef.ToString() + if List.isEmpty x.GenericArgs then "" else "<...>"
member x.BasicQualifiedName =
let tc = x.TypeRef.BasicQualifiedName
- if ILList.isEmpty x.GenericArgs then
+ if List.isEmpty x.GenericArgs then
tc
else
- tc + "[" + String.concat "," (x.GenericArgs |> ILList.map (fun arg -> "[" + arg.QualifiedNameWithNoShortPrimaryAssembly + "]")) + "]"
+ tc + "[" + String.concat "," (x.GenericArgs |> List.map (fun arg -> "[" + arg.QualifiedNameWithNoShortPrimaryAssembly + "]")) + "]"
member x.AddQualifiedNameExtensionWithNoShortPrimaryAssembly(basic) =
x.TypeRef.AddQualifiedNameExtensionWithNoShortPrimaryAssembly(basic)
@@ -783,18 +674,11 @@ and []
ArgTypes: ILTypes;
ReturnType: ILType }
-and ILGenericArgs = ILList
-and ILTypes = ILList
+and ILGenericArgs = list
+and ILTypes = list
-let emptyILTypes = (ILList.empty : ILTypes)
-let emptyILGenericArgs = (ILList.empty: ILGenericArgs)
-
-let mkILTypes xs = (match xs with [] -> emptyILTypes | _ -> ILList.ofList xs)
-let mkILGenericArgs xs = (match xs with [] -> emptyILGenericArgs | _ -> ILList.ofList xs)
-
-let mkILCallSigRaw (cc,args,ret) = { ArgTypes=args; CallingConv=cc; ReturnType=ret}
-let mkILCallSig (cc,args,ret) = mkILCallSigRaw(cc, mkILTypes args, ret)
+let mkILCallSig (cc,args,ret) = { ArgTypes=args; CallingConv=cc; ReturnType=ret}
let mkILBoxedType (tspec:ILTypeSpec) = tspec.TypeRef.AsBoxedType tspec
type ILMethodRef =
@@ -808,11 +692,11 @@ type ILMethodRef =
member x.CallingConv = x.mrefCallconv
member x.Name = x.mrefName
member x.GenericArity = x.mrefGenericArity
- member x.ArgCount = x.mrefArgs.Length
+ member x.ArgCount = List.length x.mrefArgs
member x.ArgTypes = x.mrefArgs
member x.ReturnType = x.mrefReturn
- member x.CallingSignature = mkILCallSigRaw (x.CallingConv,x.ArgTypes,x.ReturnType)
+ member x.CallingSignature = mkILCallSig (x.CallingConv,x.ArgTypes,x.ReturnType)
static member Create(a,b,c,d,e,f) =
{ mrefParent= a;mrefCallconv=b;mrefName=c;mrefGenericArity=d; mrefArgs=e;mrefReturn=f }
override x.ToString() = x.EnclosingTypeRef.ToString() + "::" + x.Name + "(...)"
@@ -1152,9 +1036,7 @@ type ILLocal =
IsPinned: bool;
DebugInfo: (string * int * int) option }
-type ILLocals = ILList
-let emptyILLocals = (ILList.empty : ILLocals)
-let mkILLocals xs = (match xs with [] -> emptyILLocals | _ -> ILList.ofList xs)
+type ILLocals = list
[]
type ILMethodBody =
@@ -1369,10 +1251,7 @@ type ILParameter =
IsOptional: bool;
CustomAttrs: ILAttributes }
-type ILParameters = ILList
-let emptyILParameters = (ILList.empty : ILParameters)
-
-let mkILParametersRaw x = (match x with [] -> emptyILParameters | _ -> ILList.ofList x)
+type ILParameters = list
[]
type ILReturn =
@@ -1418,8 +1297,7 @@ type MethodCodeKind =
let mkMethBodyAux mb = ILLazyMethodBody (Lazy.CreateFromValue mb)
let mkMethBodyLazyAux mb = ILLazyMethodBody mb
-let typesOfILParamsRaw (ps:ILParameters) : ILTypes = ps |> ILList.map (fun p -> p.Type)
-let typesOfILParamsList (ps:ILParameter list) = ps |> List.map (fun p -> p.Type)
+let typesOfILParams (ps:ILParameters) : ILTypes = ps |> List.map (fun p -> p.Type)
[]
type ILGenericVariance =
@@ -1466,14 +1344,14 @@ type ILMethodDef =
IsNoInline: bool;
GenericParams: ILGenericParameterDefs;
CustomAttrs: ILAttributes; }
- member x.ParameterTypes = typesOfILParamsRaw x.Parameters
+ member x.ParameterTypes = typesOfILParams x.Parameters
// Whidbey feature: SafeHandle finalizer must be run
member md.Code =
match md.mdBody.Contents with
| MethodBody.IL il-> Some il.Code
| _ -> None
member x.IsIL = match x.mdBody.Contents with | MethodBody.IL _ -> true | _ -> false
- member x.Locals = match x.mdBody.Contents with | MethodBody.IL il -> il.Locals | _ -> emptyILLocals
+ member x.Locals = match x.mdBody.Contents with | MethodBody.IL il -> il.Locals | _ -> []
member x.MethodBody = match x.mdBody.Contents with MethodBody.IL il -> il | _ -> failwith "not IL"
@@ -1492,7 +1370,7 @@ type ILMethodDef =
member x.IsCheckAccessOnOverride= match x.mdKind with | MethodKind.Virtual v -> v.IsCheckAccessOnOverride | _ -> invalidOp "not virtual"
member x.IsAbstract = match x.mdKind with | MethodKind.Virtual v -> v.IsAbstract | _ -> invalidOp "not virtual"
- member md.CallingSignature = mkILCallSigRaw (md.CallingConv,md.ParameterTypes,md.Return.Type)
+ member md.CallingSignature = mkILCallSig (md.CallingConv,md.ParameterTypes,md.Return.Type)
/// Index table by name and arity.
@@ -1521,10 +1399,9 @@ type ILMethodDefs(f : (unit -> ILMethodDef[])) =
member x.GetEnumerator() = (array.Value :> IEnumerable).GetEnumerator()
member x.AsArray = array.Value
- member x.AsList = x.AsArray |> Array.toList
+ member x.AsList = array.Value|> Array.toList
member x.FindByName nm = if dict.Value.ContainsKey nm then dict.Value.[nm] else []
- member x.FindByNameAndArity (nm,arity) = x.FindByName nm |> List.filter (fun x -> x.Parameters.Length = arity)
-
+ member x.FindByNameAndArity (nm,arity) = x.FindByName nm |> List.filter (fun x -> List.length x.Parameters = arity)
[]
type ILEventDef =
@@ -1837,7 +1714,7 @@ type ILType with
member x.GenericArgs =
match x with
| ILType.Boxed tspec | ILType.Value tspec -> tspec.GenericArgs
- | _ -> emptyILGenericArgs
+ | _ -> []
member x.IsTyvar =
match x with
| ILType.TypeVar _ -> true | _ -> false
@@ -1853,8 +1730,7 @@ let mkILTyRef (scope,nm) = mkILNestedTyRef (scope,[],nm)
type ILGenericArgsList = ILType list
-let mkILTySpecRaw (tref,inst) = ILTypeSpec.Create(tref, inst)
-let mkILTySpec (tref,inst) = mkILTySpecRaw (tref, mkILGenericArgs inst)
+let mkILTySpec (tref,inst) = ILTypeSpec.Create(tref, inst)
let mkILNonGenericTySpec tref = mkILTySpec (tref,[])
@@ -1864,12 +1740,10 @@ let mkILTyRefInTyRef (tref:ILTypeRef,nm) =
let mkILTy boxed tspec =
match boxed with AsObject -> mkILBoxedType tspec | _ -> ILType.Value tspec
-let mkILNamedTy vc tref tinst = mkILTy vc (ILTypeSpec.Create(tref, mkILGenericArgs tinst))
-let mkILNamedTyRaw vc tref tinst = mkILTy vc (ILTypeSpec.Create(tref, tinst))
+let mkILNamedTy vc tref tinst = mkILTy vc (ILTypeSpec.Create(tref, tinst))
let mkILValueTy tref tinst = mkILNamedTy AsValue tref tinst
let mkILBoxedTy tref tinst = mkILNamedTy AsObject tref tinst
-let mkILBoxedTyRaw tref tinst = mkILNamedTyRaw AsObject tref tinst
let mkILNonGenericValueTy tref = mkILNamedTy AsValue tref []
let mkILNonGenericBoxedTy tref = mkILNamedTy AsObject tref []
@@ -1913,7 +1787,7 @@ let mkILTypeForGlobalFunctions scoref = mkILBoxedType (mkILNonGenericTySpec (ILT
let isTypeNameForGlobalFunctions d = (d = typeNameForGlobalFunctions)
-let mkILMethRefRaw (tref,callconv,nm,gparams,args,rty) =
+let mkILMethRef (tref,callconv,nm,gparams,args,rty) =
{ mrefParent=tref;
mrefCallconv=callconv;
mrefGenericArity=gparams;
@@ -1921,25 +1795,18 @@ let mkILMethRefRaw (tref,callconv,nm,gparams,args,rty) =
mrefArgs=args;
mrefReturn=rty}
-let mkILMethRef (tref,callconv,nm,gparams,args,rty) = mkILMethRefRaw (tref,callconv,nm,gparams,mkILTypes args,rty)
-
-let mkILMethSpecForMethRefInTyRaw (mref,typ,minst) =
+let mkILMethSpecForMethRefInTy (mref,typ,minst) =
{ mspecMethodRef=mref;
mspecEnclosingType=typ;
mspecMethodInst=minst }
-let mkILMethSpecForMethRefInTy (mref,typ,minst) = mkILMethSpecForMethRefInTyRaw (mref,typ,mkILGenericArgs minst)
-
let mkILMethSpec (mref, vc, tinst, minst) = mkILMethSpecForMethRefInTy (mref,mkILNamedTy vc mref.EnclosingTypeRef tinst, minst)
let mk_mspec_in_tref (tref,vc,cc,nm,args,rty,tinst,minst) =
mkILMethSpec (mkILMethRef ( tref,cc,nm,List.length minst,args,rty),vc,tinst,minst)
-let mkILMethSpecInTyRaw (typ:ILType, cc, nm, args, rty, minst:ILGenericArgs) =
- mkILMethSpecForMethRefInTyRaw (mkILMethRefRaw (typ.TypeRef,cc,nm,minst.Length,args,rty),typ,minst)
-
-let mkILMethSpecInTy (typ:ILType, cc, nm, args, rty, minst) =
- mkILMethSpecForMethRefInTy (mkILMethRef (typ.TypeRef,cc,nm,List.length minst,args,rty),typ,minst)
+let mkILMethSpecInTy (typ:ILType, cc, nm, args, rty, minst:ILGenericArgs) =
+ mkILMethSpecForMethRefInTy (mkILMethRef (typ.TypeRef,cc,nm,minst.Length,args,rty),typ,minst)
let mkILNonGenericMethSpecInTy (typ,cc,nm,args,rty) =
mkILMethSpecInTy (typ,cc,nm,args,rty,[])
@@ -2030,7 +1897,7 @@ let mkILTyvarTy tv = ILType.TypeVar tv
let mkILSimpleTypar nm =
{ Name=nm;
- Constraints=emptyILTypes;
+ Constraints = []
Variance=NonVariant;
HasReferenceTypeConstraint=false;
HasNotNullableValueTypeConstraint=false;
@@ -2040,11 +1907,7 @@ let mkILSimpleTypar nm =
let gparam_of_gactual (_ga:ILType) = mkILSimpleTypar "T"
let mkILFormalTypars (x: ILGenericArgsList) = List.map gparam_of_gactual x
-let mkILFormalTyparsRaw (x: ILGenericArgs) = ILList.toList (ILList.map gparam_of_gactual x)
-let mkILFormalGenericArgsRaw (gparams:ILGenericParameterDefs) =
- ILList.ofList (List.mapi (fun n _gf -> mkILTyvarTy (uint16 n)) gparams)
-
let mkILFormalGenericArgs (gparams:ILGenericParameterDefs) =
List.mapi (fun n _gf -> mkILTyvarTy (uint16 n)) gparams
@@ -2637,7 +2500,7 @@ let rec rescopeILTypeSpecQuick scoref (tspec:ILTypeSpec) =
let tref = tspec.TypeRef
let tinst = tspec.GenericArgs
let qtref = qrescope_tref scoref tref
- if ILList.isEmpty tinst && Option.isNone qtref then
+ if List.isEmpty tinst && Option.isNone qtref then
None (* avoid reallocation in the common case *)
else
match qtref with
@@ -2667,11 +2530,11 @@ and rescopeILType scoref typ =
| x -> x
and rescopeILTypes scoref i =
- if ILList.isEmpty i then i
- else ILList.map (rescopeILType scoref) i
+ if List.isEmpty i then i
+ else List.map (rescopeILType scoref) i
and rescopeILCallSig scoref csig =
- mkILCallSigRaw (csig.CallingConv,rescopeILTypes scoref csig.ArgTypes,rescopeILType scoref csig.ReturnType)
+ mkILCallSig (csig.CallingConv,rescopeILTypes scoref csig.ArgTypes,rescopeILType scoref csig.ReturnType)
let rescopeILMethodRef scoref (x:ILMethodRef) =
{ mrefParent = rescopeILTypeRef scoref x.EnclosingTypeRef;
@@ -2708,13 +2571,13 @@ and instILTypeAux numFree (inst:ILGenericArgs) typ =
if v - numFree >= top then
ILType.TypeVar (uint16 (v - top))
else
- ILList.item (v - numFree) inst
+ List.item (v - numFree) inst
| x -> x
-and instILGenericArgsAux numFree inst i = ILList.map (instILTypeAux numFree inst) i
+and instILGenericArgsAux numFree inst i = List.map (instILTypeAux numFree inst) i
and instILCallSigAux numFree inst csig =
- mkILCallSigRaw (csig.CallingConv,ILList.map (instILTypeAux numFree inst) csig.ArgTypes,instILTypeAux numFree inst csig.ReturnType)
+ mkILCallSig (csig.CallingConv,List.map (instILTypeAux numFree inst) csig.ArgTypes,instILTypeAux numFree inst csig.ReturnType)
let instILType i t = instILTypeAux 0 i t
@@ -2774,7 +2637,7 @@ let mkILCtor (access,args,impl) =
{ Name=".ctor";
mdKind=MethodKind.Ctor;
CallingConv=ILCallingConv.Instance;
- Parameters=mkILParametersRaw args;
+ Parameters = args
Return= mkILVoidReturn;
Access=access;
mdBody= mkMethBodyAux impl;
@@ -2827,7 +2690,7 @@ let mkILStaticMethod (genparams,nm,access,args,ret,impl) =
Name=nm;
CallingConv = ILCallingConv.Static;
mdKind=MethodKind.Static;
- Parameters= mkILParametersRaw args;
+ Parameters = args
Return= ret;
Access=access;
HasSecurity=false;
@@ -2856,7 +2719,7 @@ let mkILClassCtor impl =
CallingConv=ILCallingConv.Static;
GenericParams=mkILEmptyGenericParams;
mdKind=MethodKind.Cctor;
- Parameters=emptyILParameters;
+ Parameters = []
Return=mkILVoidReturn;
Access=ILMemberAccess.Private;
IsEntryPoint=false;
@@ -2896,7 +2759,7 @@ let mkILGenericVirtualMethod (nm,access,genparams,actual_args,actual_ret,impl) =
IsNewSlot = false;
IsCheckAccessOnOverride=true;
IsAbstract=(match impl with MethodBody.Abstract -> true | _ -> false) ; };
- Parameters= mkILParametersRaw actual_args;
+ Parameters=actual_args;
Return=actual_ret;
Access=access;
IsEntryPoint=false;
@@ -2925,7 +2788,7 @@ let mkILGenericNonVirtualMethod (nm,access,genparams, actual_args,actual_ret, im
GenericParams=genparams;
CallingConv=ILCallingConv.Instance;
mdKind=MethodKind.NonVirtual;
- Parameters= mkILParametersRaw actual_args;
+ Parameters=actual_args;
Return=actual_ret;
Access=access;
IsEntryPoint=false;
@@ -2987,7 +2850,7 @@ let cdef_cctorCode2CodeOrCreate tag f cd =
let cctor =
match mdefs.FindByName ".cctor" with
| [mdef] -> mdef
- | [] -> mkILClassCtor (mkMethodBody (false,emptyILLocals,1,nonBranchingInstrsToCode [ ],tag))
+ | [] -> mkILClassCtor (mkMethodBody (false,[],1,nonBranchingInstrsToCode [ ],tag))
| _ -> failwith "bad method table: more than one .cctor found"
let methods = ILMethodDefs (fun () -> [| yield f cctor; for md in mdefs do if md.Name <> ".cctor" then yield md |])
@@ -3000,7 +2863,7 @@ let code_of_mdef (md:ILMethodDef) =
| None -> failwith "code_of_mdef: not IL"
let mkRefToILMethod (tref, md: ILMethodDef) =
- mkILMethRefRaw (tref, md.CallingConv, md.Name, md.GenericParams.Length, md.ParameterTypes, md.Return.Type)
+ mkILMethRef (tref, md.CallingConv, md.Name, md.GenericParams.Length, md.ParameterTypes, md.Return.Type)
let mkRefToILField (tref,fdef:ILFieldDef) = mkILFieldRef (tref, fdef.Name, fdef.Type)
@@ -3093,7 +2956,7 @@ let mkILStorageCtorWithParamNames(tag,preblock,typ,flds,access) =
mkILCtor(access,
flds |> List.map (fun (pnm,_,ty) -> mkILParamNamed (pnm,ty)),
mkMethodBody
- (false,emptyILLocals,2,
+ (false,[],2,
nonBranchingInstrsToCode
begin
(match tag with Some x -> [I_seqpoint x] | None -> []) @
@@ -3128,7 +2991,7 @@ let mkILGenericClass (nm, access, genparams, extends, impl, methods, fields, nes
Name=nm;
GenericParams= genparams;
Access = access;
- Implements = mkILTypes impl;
+ Implements = impl
IsAbstract = false;
IsSealed = false;
IsSerializable = false;
@@ -3154,7 +3017,7 @@ let mkRawDataValueTypeDef ilg (nm,size,pack) =
Name = nm;
GenericParams= [];
Access = ILTypeDefAccess.Private;
- Implements = emptyILTypes;
+ Implements = []
IsAbstract = false;
IsSealed = true;
Extends = Some ilg.typ_ValueType;
@@ -3846,7 +3709,7 @@ type ILTypeSigParser(tstring : string) =
let tref = mkILTyRef(scope, typeName)
let genericArgs =
match specializations with
- | None -> emptyILGenericArgs
+ | None -> []
| Some(genericArgs) -> genericArgs
let tspec = ILTypeSpec.Create(tref,genericArgs)
let ilty =
@@ -3960,7 +3823,7 @@ let decodeILAttribData ilg (ca: ILAttribute) =
let nh,sigptr = parseVal h sigptr
let nt,sigptr = parseFixed t sigptr
nh ::nt, sigptr
- let fixedArgs,sigptr = parseFixed (ILList.toList ca.Method.FormalArgTypes) sigptr
+ let fixedArgs,sigptr = parseFixed ca.Method.FormalArgTypes sigptr
let nnamed,sigptr = sigptr_get_u16 bytes sigptr
let rec parseNamed acc n sigptr =
if n = 0 then List.rev acc else
@@ -4057,7 +3920,7 @@ and refs_of_fspec s x =
refs_of_fref s x.FieldRef;
refs_of_typ s x.EnclosingType
-and refs_of_typs s l = ILList.iter (refs_of_typ s) l
+and refs_of_typs s l = List.iter (refs_of_typ s) l
and refs_of_token s x =
match x with
@@ -4110,7 +3973,7 @@ and refs_of_il_code s (c: ILCode) =
| _ -> ()))
and refs_of_ilmbody s (il: ILMethodBody) =
- ILList.iter (refs_of_local s) il.Locals
+ List.iter (refs_of_local s) il.Locals
refs_of_il_code s il.Code
and refs_of_local s loc = refs_of_typ s loc.Type
@@ -4122,7 +3985,7 @@ and refs_of_mbody s x =
| _ -> ()
and refs_of_mdef s md =
- ILList.iter (refs_of_param s) md.Parameters;
+ List.iter (refs_of_param s) md.Parameters;
refs_of_return s md.Return;
refs_of_mbody s md.mdBody.Contents;
refs_of_custom_attrs s md.CustomAttrs;
@@ -4270,7 +4133,7 @@ let resolveILMethodRefWithRescope r td (mref:ILMethodRef) =
possibles |> List.filter (fun md ->
mref.CallingConv = md.CallingConv &&
// REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct
- (md.Parameters,mref.ArgTypes) ||> ILList.lengthsEqAndForall2 (fun p1 p2 -> r p1.Type = p2) &&
+ (md.Parameters,mref.ArgTypes) ||> List.lengthsEqAndForall2 (fun p1 p2 -> r p1.Type = p2) &&
// REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct
r md.Return.Type = mref.ReturnType) with
| [] -> failwith ("no method named "+nm+" with appropriate argument types found in type "+td.Name)
diff --git a/src/absil/il.fsi b/src/absil/il.fsi
index 6afa9974997..dcfce4cbc2d 100644
--- a/src/absil/il.fsi
+++ b/src/absil/il.fsi
@@ -7,20 +7,6 @@ module internal Microsoft.FSharp.Compiler.AbstractIL.IL
open Internal.Utilities
open System.Collections.Generic
-/// The type used to store relatively small lists in the Abstract IL data structures, i.e. for ILTypes, ILGenericArgs, ILParameters and ILLocals.
-/// See comments in il.fs for why we've isolated this representation and the possible future choices we might use here.
-#if ABSIL_USES_ARRAY_FOR_ILLIST
-type ILList<'T> = 'T []
-#endif
-
-#if ABSIL_USES_THREELIST_FOR_ILLIST
-type ILList<'T> = ThreeList<'T>
-#endif
-
-//#if ABSIL_USES_LIST_FOR_ILLIST
-type ILList<'T> = 'T list
-//#endif
-
type PrimaryAssembly =
| Mscorlib
| DotNetCore
@@ -361,28 +347,8 @@ and []
/// Actual generic parameters are always types.
-and ILGenericArgs = ILList
-and ILTypes = ILList
-
-
-[]
-module ILList =
- val inline map : ('T -> 'U) -> ILList<'T> -> ILList<'U>
- val inline mapi : (int -> 'T -> 'U) -> ILList<'T> -> ILList<'U>
- val inline isEmpty : ILList<'T> -> bool
- val inline toList : ILList<'T> -> 'T list
- val inline ofList : 'T list -> ILList<'T>
- val inline lengthsEqAndForall2 : ('T -> 'U -> bool) -> ILList<'T> -> ILList<'U> -> bool
- val inline init : int -> (int -> 'T) -> ILList<'T>
- val inline empty<'T> : ILList<'T>
- val inline toArray : ILList<'T> -> 'T[]
- val inline ofArray : 'T[] -> ILList<'T>
- val inline nth : ILList<'T> -> int -> 'T
- val inline iter : ('T -> unit) -> ILList<'T> -> unit
- val inline iteri : (int -> 'T -> unit) -> ILList<'T> -> unit
- val inline foldBack : ('T -> 'State -> 'State) -> ILList<'T> -> 'State -> 'State
- val inline exists : ('T -> bool) -> ILList<'T> -> bool
-
+and ILGenericArgs = list
+and ILTypes = list
/// Formal identities of methods. Method refs refer to methods on
/// named types. In general you should work with ILMethodSpec objects
@@ -817,8 +783,7 @@ type ILLocal =
IsPinned: bool;
DebugInfo: (string * int * int) option }
-
-type ILLocals = ILList
+type ILLocals = list
/// IL method bodies
[]
@@ -891,10 +856,9 @@ type ILParameter =
IsOptional: bool;
CustomAttrs: ILAttributes }
-type ILParameters = ILList
+type ILParameters = list
-val typesOfILParamsRaw : ILParameters -> ILTypes
-val typesOfILParamsList : ILParameter list -> ILType list
+val typesOfILParams : ILParameters -> ILType list
/// Method return values.
[]
@@ -1658,7 +1622,6 @@ val decodeILAttribData:
val mkSimpleAssRef: string -> ILAssemblyRef
val mkSimpleModRef: string -> ILModuleRef
-val emptyILGenericArgs: ILGenericArgs
val mkILTyvarTy: uint16 -> ILType
/// Make type refs.
@@ -1667,18 +1630,15 @@ val mkILTyRef: ILScopeRef * string -> ILTypeRef
val mkILTyRefInTyRef: ILTypeRef * string -> ILTypeRef
type ILGenericArgsList = ILType list
-val mkILGenericArgs : ILGenericArgsList -> ILGenericArgs
+
/// Make type specs.
val mkILNonGenericTySpec: ILTypeRef -> ILTypeSpec
val mkILTySpec: ILTypeRef * ILGenericArgsList -> ILTypeSpec
-val mkILTySpecRaw: ILTypeRef * ILGenericArgs -> ILTypeSpec
/// Make types.
val mkILTy: ILBoxity -> ILTypeSpec -> ILType
val mkILNamedTy: ILBoxity -> ILTypeRef -> ILGenericArgsList -> ILType
-val mkILNamedTyRaw: ILBoxity -> ILTypeRef -> ILGenericArgs -> ILType
val mkILBoxedTy: ILTypeRef -> ILGenericArgsList -> ILType
-val mkILBoxedTyRaw: ILTypeRef -> ILGenericArgs -> ILType
val mkILValueTy: ILTypeRef -> ILGenericArgsList -> ILType
val mkILNonGenericBoxedTy: ILTypeRef -> ILType
val mkILNonGenericValueTy: ILTypeRef -> ILType
@@ -1688,16 +1648,11 @@ val isILArrTy: ILType -> bool
val destILArrTy: ILType -> ILArrayShape * ILType
val mkILBoxedType : ILTypeSpec -> ILType
-val mkILTypes : ILType list -> ILTypes
-
/// Make method references and specs.
-val mkILMethRefRaw: ILTypeRef * ILCallingConv * string * int * ILTypes * ILType -> ILMethodRef
val mkILMethRef: ILTypeRef * ILCallingConv * string * int * ILType list * ILType -> ILMethodRef
val mkILMethSpec: ILMethodRef * ILBoxity * ILGenericArgsList * ILGenericArgsList -> ILMethodSpec
-val mkILMethSpecForMethRefInTyRaw: ILMethodRef * ILType * ILGenericArgs -> ILMethodSpec
val mkILMethSpecForMethRefInTy: ILMethodRef * ILType * ILGenericArgsList -> ILMethodSpec
val mkILMethSpecInTy: ILType * ILCallingConv * string * ILType list * ILType * ILGenericArgsList -> ILMethodSpec
-val mkILMethSpecInTyRaw: ILType * ILCallingConv * string * ILTypes * ILType * ILGenericArgs -> ILMethodSpec
/// Construct references to methods on a given type .
val mkILNonGenericMethSpecInTy: ILType * ILCallingConv * string * ILType list * ILType -> ILMethodSpec
@@ -1722,7 +1677,6 @@ val mkILFieldRef: ILTypeRef * string * ILType -> ILFieldRef
val mkILFieldSpec: ILFieldRef * ILType -> ILFieldSpec
val mkILFieldSpecInTy: ILType * string * ILType -> ILFieldSpec
-val mkILCallSigRaw: ILCallingConv * ILTypes * ILType -> ILCallingSignature
val mkILCallSig: ILCallingConv * ILType list * ILType -> ILCallingSignature
/// Make generalized verions of possibly-generic types,
@@ -1730,9 +1684,7 @@ val mkILCallSig: ILCallingConv * ILType list * ILType -> ILCallingSignature
val mkILFormalBoxedTy: ILTypeRef -> ILGenericParameterDef list -> ILType
val mkILFormalNamedTy: ILBoxity -> ILTypeRef -> ILGenericParameterDef list -> ILType
-val mkILFormalTyparsRaw: ILTypes -> ILGenericParameterDefs
val mkILFormalTypars: ILType list -> ILGenericParameterDefs
-val mkILFormalGenericArgsRaw: ILGenericParameterDefs -> ILGenericArgs
val mkILFormalGenericArgs: ILGenericParameterDefs -> ILGenericArgsList
val mkILSimpleTypar : string -> ILGenericParameterDef
/// Make custom attributes.
@@ -1794,8 +1746,6 @@ val mkILParamAnon: ILType -> ILParameter
val mkILParamNamed: string * ILType -> ILParameter
val mkILReturn: ILType -> ILReturn
val mkILLocal: ILType -> (string * int * int) option -> ILLocal
-val mkILLocals : ILLocal list -> ILLocals
-val emptyILLocals : ILLocals
/// Make a formal generic parameters.
val mkILEmptyGenericParams: ILGenericParameterDefs
diff --git a/src/absil/illib.fs b/src/absil/illib.fs
index 91b44acd2b7..661ecbcbb55 100644
--- a/src/absil/illib.fs
+++ b/src/absil/illib.fs
@@ -483,64 +483,6 @@ module ResultOrException =
| Result x -> success x
| Exception _err -> f()
-
-//-------------------------------------------------------------------------
-// Library: extensions to flat list (immutable arrays)
-//------------------------------------------------------------------------
-#if FLAT_LIST_AS_ARRAY_STRUCT
-//#else
-module FlatList =
-
- let order (eltOrder: IComparer<_>) =
- { new IComparer> with
- member __.Compare(xs,ys) =
- match xs.array,ys.array with
- | null,null -> 0
- | _,null -> 1
- | null,_ -> -1
- | arr1,arr2 -> Array.order eltOrder arr1 arr2 }
-
- let mapq f (x:FlatList<_>) =
- match x.array with
- | null -> x
- | arr ->
- let arr' = Array.map f arr in
- let n = arr.Length in
- let rec check i = if i >= n then true else arr.[i] === arr'.[i] && check (i+1)
- if check 0 then x else FlatList(arr')
-
- let mapFold f acc (x:FlatList<_>) =
- match x.array with
- | null ->
- FlatList.Empty,acc
- | arr ->
- let arr,acc = Array.mapFold f acc x.array
- FlatList(arr),acc
-
-#endif
-#if FLAT_LIST_AS_LIST
-
-#else
-
-module FlatList =
- let toArray xs = List.toArray xs
- let choose f xs = List.choose f xs
- let order eltOrder = List.order eltOrder
- let mapq f (x:FlatList<_>) = List.mapq f x
- let mapFold f acc (x:FlatList<_>) = List.mapFold f acc x
-
-#endif
-
-#if FLAT_LIST_AS_ARRAY
-//#else
-module FlatList =
- let order eltOrder = Array.order eltOrder
- let mapq f x = Array.mapq f x
- let mapFold f acc x = Array.mapFold f acc x
-#endif
-
-
-
/// Computations that can cooperatively yield by returning a continuation
///
/// - Any yield of a NotYetDone should typically be "abandonable" without adverse consequences. No resource release
@@ -781,7 +723,6 @@ module NameMap =
let ofKeyedList f l = List.foldBack (fun x acc -> Map.add (f x) x acc) l Map.empty
let ofList l : NameMap<'T> = Map.ofList l
let ofSeq l : NameMap<'T> = Map.ofSeq l
- let ofFlatList (l:FlatList<_>) : NameMap<'T> = FlatList.toMap l
let toList (l: NameMap<'T>) = Map.toList l
let layer (m1 : NameMap<'T>) m2 = Map.foldBack Map.add m1 m2
diff --git a/src/absil/ilmorph.fs b/src/absil/ilmorph.fs
index b166a1303df..f6bc4d1e553 100644
--- a/src/absil/ilmorph.fs
+++ b/src/absil/ilmorph.fs
@@ -55,7 +55,7 @@ let rec typ_tref2tref f x =
| ILType.FunctionPointer x ->
ILType.FunctionPointer
{ x with
- ArgTypes=ILList.map (typ_tref2tref f) x.ArgTypes;
+ ArgTypes=List.map (typ_tref2tref f) x.ArgTypes;
ReturnType=typ_tref2tref f x.ReturnType}
| ILType.Byref t -> ILType.Byref (typ_tref2tref f t)
| ILType.Boxed cr -> mkILBoxedType (tspec_tref2tref f cr)
@@ -65,7 +65,7 @@ let rec typ_tref2tref f x =
| ILType.Modified (req,tref,ty) -> ILType.Modified (req, f tref, typ_tref2tref f ty)
| ILType.Void -> ILType.Void
and tspec_tref2tref f (x:ILTypeSpec) =
- mkILTySpecRaw(f x.TypeRef, ILList.map (typ_tref2tref f) x.GenericArgs)
+ mkILTySpec(f x.TypeRef, List.map (typ_tref2tref f) x.GenericArgs)
let rec typ_scoref2scoref_tyvar2typ ((_fscope,ftyvar) as fs)x =
match x with
@@ -81,9 +81,9 @@ and tspec_scoref2scoref_tyvar2typ fs (x:ILTypeSpec) =
ILTypeSpec.Create(morphILScopeRefsInILTypeRef (fst fs) x.TypeRef,typs_scoref2scoref_tyvar2typ fs x.GenericArgs)
and callsig_scoref2scoref_tyvar2typ f x =
{ x with
- ArgTypes=ILList.map (typ_scoref2scoref_tyvar2typ f) x.ArgTypes;
+ ArgTypes=List.map (typ_scoref2scoref_tyvar2typ f) x.ArgTypes;
ReturnType=typ_scoref2scoref_tyvar2typ f x.ReturnType}
-and typs_scoref2scoref_tyvar2typ f i = ILList.map (typ_scoref2scoref_tyvar2typ f) i
+and typs_scoref2scoref_tyvar2typ f i = List.map (typ_scoref2scoref_tyvar2typ f) i
and gparams_scoref2scoref_tyvar2typ f i = List.map (gparam_scoref2scoref_tyvar2typ f) i
and gparam_scoref2scoref_tyvar2typ _f i = i
and morphILScopeRefsInILTypeRef fscope (x:ILTypeRef) =
@@ -92,27 +92,27 @@ and morphILScopeRefsInILTypeRef fscope (x:ILTypeRef) =
let callsig_typ2typ f (x: ILCallingSignature) =
{ CallingConv=x.CallingConv;
- ArgTypes=ILList.map f x.ArgTypes;
+ ArgTypes=List.map f x.ArgTypes;
ReturnType=f x.ReturnType}
-let gparam_typ2typ f gf = {gf with Constraints = ILList.map f gf.Constraints}
+let gparam_typ2typ f gf = {gf with Constraints = List.map f gf.Constraints}
let gparams_typ2typ f gfs = List.map (gparam_typ2typ f) gfs
-let typs_typ2typ (f: ILType -> ILType) x = ILList.map f x
+let typs_typ2typ (f: ILType -> ILType) x = List.map f x
let mref_typ2typ (f: ILType -> ILType) (x:ILMethodRef) =
ILMethodRef.Create(enclosingTypeRef= (f (mkILBoxedType (mkILNonGenericTySpec x.EnclosingTypeRef))).TypeRef,
callingConv=x.CallingConv,
name=x.Name,
genericArity=x.GenericArity,
- argTypes= ILList.map f x.ArgTypes,
+ argTypes= List.map f x.ArgTypes,
returnType= f x.ReturnType)
type formal_scopeCtxt = Choice
let mspec_typ2typ (((factualty : ILType -> ILType) , (fformalty: formal_scopeCtxt -> ILType -> ILType))) (x: ILMethodSpec) =
- mkILMethSpecForMethRefInTyRaw(mref_typ2typ (fformalty (Choice1Of2 x)) x.MethodRef,
- factualty x.EnclosingType,
- typs_typ2typ factualty x.GenericArgs)
+ mkILMethSpecForMethRefInTy(mref_typ2typ (fformalty (Choice1Of2 x)) x.MethodRef,
+ factualty x.EnclosingType,
+ typs_typ2typ factualty x.GenericArgs)
let fref_typ2typ (f: ILType -> ILType) x =
{ x with EnclosingTypeRef = (f (mkILBoxedType (mkILNonGenericTySpec x.EnclosingTypeRef))).TypeRef;
@@ -155,7 +155,7 @@ let fdef_typ2typ ilg ftype (fd: ILFieldDef) =
CustomAttrs=cattrs_typ2typ ilg ftype fd.CustomAttrs}
let local_typ2typ f (l: ILLocal) = {l with Type = f l.Type}
-let varargs_typ2typ f (varargs: ILVarArgs) = Option.map (ILList.map f) varargs
+let varargs_typ2typ f (varargs: ILVarArgs) = Option.map (List.map f) varargs
(* REVIEW: convert varargs *)
let morphILTypesInILInstr ((factualty,fformalty)) i =
let factualty = factualty (Some i)
@@ -205,7 +205,7 @@ let fdefs_fdef2fdef f (m:ILFieldDefs) = mkILFields (List.map f m.AsList)
(* use this when the conversion produces just one type... *)
let morphILTypeDefs f (m: ILTypeDefs) = mkILTypeDefsFromArray (Array.map f m.AsArray)
-let locals_typ2typ f ls = ILList.map (local_typ2typ f) ls
+let locals_typ2typ f ls = List.map (local_typ2typ f) ls
let ilmbody_instr2instr_typ2typ fs (il: ILMethodBody) =
let (finstr,ftype) = fs
@@ -228,7 +228,7 @@ let mdef_typ2typ_ilmbody2ilmbody ilg fs md =
{md with
GenericParams=gparams_typ2typ ftype' md.GenericParams;
mdBody= body';
- Parameters = ILList.map (param_typ2typ ilg ftype') md.Parameters;
+ Parameters = List.map (param_typ2typ ilg ftype') md.Parameters;
Return = return_typ2typ ilg ftype' md.Return;
CustomAttrs=cattrs_typ2typ ilg ftype' md.CustomAttrs }
@@ -254,7 +254,7 @@ let pdef_typ2typ ilg f p =
SetMethod = Option.map (mref_typ2typ f) p.SetMethod;
GetMethod = Option.map (mref_typ2typ f) p.GetMethod;
Type = f p.Type;
- Args = ILList.map f p.Args;
+ Args = List.map f p.Args;
CustomAttrs = cattrs_typ2typ ilg f p.CustomAttrs }
let pdefs_typ2typ ilg f (pdefs: ILPropertyDefs) = mkILProperties (List.map (pdef_typ2typ ilg f) pdefs.AsList)
@@ -267,7 +267,7 @@ let rec tdef_typ2typ_ilmbody2ilmbody_mdefs2mdefs ilg enc fs td =
let ftype' = ftype (Some (enc,td)) None
let mdefs' = fmdefs (enc,td) td.Methods
let fdefs' = fdefs_typ2typ ilg ftype' td.Fields
- {td with Implements= ILList.map ftype' td.Implements;
+ {td with Implements= List.map ftype' td.Implements;
GenericParams= gparams_typ2typ ftype' td.GenericParams;
Extends = Option.map ftype' td.Extends;
Methods=mdefs';
diff --git a/src/absil/ilpars.fsy b/src/absil/ilpars.fsy
index 22b5460d5ea..4111064cb38 100644
--- a/src/absil/ilpars.fsy
+++ b/src/absil/ilpars.fsy
@@ -26,7 +26,7 @@ type SigArg = SigArg of (string option * ILType) | Sentinel
let decodeVarargs args =
let rec normals = function
| [] -> ([],None)
- | Sentinel :: t -> ([],Some (ILList.ofList (varargs t)))
+ | Sentinel :: t -> ([],Some (varargs t))
| SigArg (_,p)::t -> let (n,r) = normals t in (p::n, r)
and varargs = function
| [] -> []
@@ -46,7 +46,7 @@ let resolveMethodSpecScopeThen (ResolvedAtMethodSpecScope f) g =
let resolveFormalMethodSpecScope tspeco obj =
match tspeco with
None -> resolveMethodSpecScope obj mkILEmptyGenericParams
- | Some (tspec:ILTypeSpec) -> resolveMethodSpecScope obj (mkILFormalTyparsRaw tspec.GenericArgs)
+ | Some (tspec:ILTypeSpec) -> resolveMethodSpecScope obj (mkILFormalTypars tspec.GenericArgs)
let resolveCurrentMethodSpecScope obj =
resolveMethodSpecScope obj mkILEmptyGenericParams
diff --git a/src/absil/ilprint.fs b/src/absil/ilprint.fs
index 6bdbf62c44d..911c9972215 100644
--- a/src/absil/ilprint.fs
+++ b/src/absil/ilprint.fs
@@ -208,7 +208,7 @@ and goutput_ldtoken_info env os = function
| ILToken.ILField x -> output_string os "field "; goutput_fspec env os x
and goutput_typ_with_shortened_class_syntax env os = function
- ILType.Boxed tspec when tspec.GenericArgs = emptyILGenericArgs ->
+ ILType.Boxed tspec when tspec.GenericArgs = [] ->
goutput_tref env os tspec.TypeRef
| typ2 -> goutput_typ env os typ2
@@ -339,7 +339,7 @@ and goutput_mref env os (mref:ILMethodRef) =
and goutput_mspec env os (mspec:ILMethodSpec) =
let fenv =
ppenv_enter_method mspec.GenericArity
- (ppenv_enter_tdef (mkILFormalTyparsRaw mspec.EnclosingType.GenericArgs) env)
+ (ppenv_enter_tdef (mkILFormalTypars mspec.EnclosingType.GenericArgs) env)
output_callconv os mspec.CallingConv;
output_string os " ";
goutput_typ fenv os mspec.FormalReturnType;
@@ -357,7 +357,7 @@ and goutput_vararg_mspec env os (mspec, varargs) =
| Some varargs' ->
let fenv =
ppenv_enter_method mspec.GenericArity
- (ppenv_enter_tdef (mkILFormalTyparsRaw mspec.EnclosingType.GenericArgs) env)
+ (ppenv_enter_tdef (mkILFormalTypars mspec.EnclosingType.GenericArgs) env)
output_callconv os mspec.CallingConv;
output_string os " ";
goutput_typ fenv os mspec.FormalReturnType;
@@ -386,7 +386,7 @@ and goutput_vararg_sig env os (csig:ILCallingSignature,varargs:ILVarArgs) =
output_string os ")";
and goutput_fspec env os (x:ILFieldSpec) =
- let fenv = ppenv_enter_tdef (mkILFormalTyparsRaw x.EnclosingType.GenericArgs) env
+ let fenv = ppenv_enter_tdef (mkILFormalTypars x.EnclosingType.GenericArgs) env
goutput_typ fenv os x.FormalType;
output_string os " ";
goutput_dlocref env os x.EnclosingType;
diff --git a/src/absil/ilread.fs b/src/absil/ilread.fs
index 2a856e622a9..614b9fb15e4 100644
--- a/src/absil/ilread.fs
+++ b/src/absil/ilread.fs
@@ -1745,7 +1745,7 @@ and seekReadTypeDef ctxt toponly (idx:int) =
IsSpecialName= (flags &&& 0x00000400) <> 0x0
Encoding=typeEncodingOfFlags flags
NestedTypes= nested
- Implements = mkILTypes impls
+ Implements = impls
Extends = super
Methods = mdefs
SecurityDecls = sdecls
@@ -1781,7 +1781,7 @@ and seekReadInterfaceImpls ctxt numtypars tidx =
fst,
simpleIndexCompare tidx,
isSorted ctxt TableNames.InterfaceImpl,
- (snd >> seekReadTypeDefOrRef ctxt numtypars AsObject (*ok*) ILList.empty))
+ (snd >> seekReadTypeDefOrRef ctxt numtypars AsObject (*ok*) List.empty))
and seekReadGenericParams ctxt numtypars (a,b) : ILGenericParameterDefs =
ctxt.seekReadGenericParams (GenericParamsIdx(numtypars,a,b))
@@ -1805,7 +1805,7 @@ and seekReadGenericParamsUncached ctxtH (GenericParamsIdx(numtypars,a,b)) =
let constraints = seekReadGenericParamConstraintsUncached ctxt numtypars gpidx
let cas = seekReadCustomAttrs ctxt (TaggedIndex(hca_GenericParam,gpidx))
seq, {Name=readStringHeap ctxt nameIdx
- Constraints=mkILTypes constraints
+ Constraints = constraints
Variance=variance
CustomAttrs=cas
HasReferenceTypeConstraint= (flags &&& 0x0004) <> 0
@@ -1820,7 +1820,7 @@ and seekReadGenericParamConstraintsUncached ctxt numtypars gpidx =
fst,
simpleIndexCompare gpidx,
isSorted ctxt TableNames.GenericParamConstraint,
- (snd >> seekReadTypeDefOrRef ctxt numtypars AsObject (*ok*) ILList.empty))
+ (snd >> seekReadTypeDefOrRef ctxt numtypars AsObject (*ok*) List.empty))
and seekReadTypeDefAsType ctxt boxity (ginst:ILTypes) idx =
ctxt.seekReadTypeDefAsType (TypeDefAsTypIdx (boxity,ginst,idx))
@@ -1873,11 +1873,11 @@ and seekReadTypeDefOrRefAsTypeRef ctxt (TaggedIndex(tag,idx) ) =
and seekReadMethodRefParent ctxt numtypars (TaggedIndex(tag,idx)) =
match tag with
- | tag when tag = mrp_TypeRef -> seekReadTypeRefAsType ctxt AsObject (* not ok - no way to tell if a member ref parent ctxt.is a value type or not *) ILList.empty idx
+ | tag when tag = mrp_TypeRef -> seekReadTypeRefAsType ctxt AsObject (* not ok - no way to tell if a member ref parent ctxt.is a value type or not *) List.empty idx
| tag when tag = mrp_ModuleRef -> mkILTypeForGlobalFunctions (ILScopeRef.Module (seekReadModuleRef ctxt idx))
| tag when tag = mrp_MethodDef ->
let (MethodData(enclTyp, cc, nm, argtys, retty, minst)) = seekReadMethodDefAsMethodData ctxt idx
- let mspec = mkILMethSpecInTyRaw(enclTyp, cc, nm, argtys, retty, minst)
+ let mspec = mkILMethSpecInTy (enclTyp, cc, nm, argtys, retty, minst)
mspec.EnclosingType
| tag when tag = mrp_TypeSpec -> readBlobHeapAsType ctxt numtypars (seekReadTypeSpecRow ctxt idx)
| _ -> failwith "seekReadMethodRefParent ctxt"
@@ -1900,10 +1900,10 @@ and seekReadCustomAttrType ctxt (TaggedIndex(tag,idx) ) =
match tag with
| tag when tag = cat_MethodDef ->
let (MethodData(enclTyp, cc, nm, argtys, retty, minst)) = seekReadMethodDefAsMethodData ctxt idx
- mkILMethSpecInTyRaw (enclTyp, cc, nm, argtys, retty, minst)
+ mkILMethSpecInTy (enclTyp, cc, nm, argtys, retty, minst)
| tag when tag = cat_MemberRef ->
let (MethodData(enclTyp, cc, nm, argtys, retty, minst)) = seekReadMemberRefAsMethDataNoVarArgs ctxt 0 idx
- mkILMethSpecInTyRaw (enclTyp, cc, nm, argtys, retty, minst)
+ mkILMethSpecInTy (enclTyp, cc, nm, argtys, retty, minst)
| _ -> failwith "seekReadCustomAttrType ctxt"
and seekReadImplAsScopeRef ctxt (TaggedIndex(tag,idx) ) =
@@ -1927,7 +1927,7 @@ and seekReadTypeRefScope ctxt (TaggedIndex(tag,idx) ) =
and seekReadOptionalTypeDefOrRef ctxt numtypars boxity idx =
if idx = TaggedIndex(tdor_TypeDef, 0) then None
- else Some (seekReadTypeDefOrRef ctxt numtypars boxity ILList.empty idx)
+ else Some (seekReadTypeDefOrRef ctxt numtypars boxity List.empty idx)
and seekReadField ctxt (numtypars, hasLayout) (idx:int) =
let (flags,nameIdx,typeIdx) = seekReadFieldRow ctxt idx
@@ -2003,15 +2003,15 @@ and sigptrGetTy ctxt numtypars bytes sigptr =
let tdorIdx, sigptr = sigptrGetTypeDefOrRefOrSpecIdx bytes sigptr
let n, sigptr = sigptrGetZInt32 bytes sigptr
let argtys,sigptr = sigptrFold (sigptrGetTy ctxt numtypars) n bytes sigptr
- seekReadTypeDefOrRef ctxt numtypars (if b0 = et_CLASS then AsObject else AsValue) (mkILTypes argtys) tdorIdx,
+ seekReadTypeDefOrRef ctxt numtypars (if b0 = et_CLASS then AsObject else AsValue) argtys tdorIdx,
sigptr
elif b0 = et_CLASS then
let tdorIdx, sigptr = sigptrGetTypeDefOrRefOrSpecIdx bytes sigptr
- seekReadTypeDefOrRef ctxt numtypars AsObject ILList.empty tdorIdx, sigptr
+ seekReadTypeDefOrRef ctxt numtypars AsObject List.empty tdorIdx, sigptr
elif b0 = et_VALUETYPE then
let tdorIdx, sigptr = sigptrGetTypeDefOrRefOrSpecIdx bytes sigptr
- seekReadTypeDefOrRef ctxt numtypars AsValue ILList.empty tdorIdx, sigptr
+ seekReadTypeDefOrRef ctxt numtypars AsValue List.empty tdorIdx, sigptr
elif b0 = et_VAR then
let n, sigptr = sigptrGetZInt32 bytes sigptr
ILType.TypeVar (uint16 n),sigptr
@@ -2059,7 +2059,7 @@ and sigptrGetTy ctxt numtypars bytes sigptr =
let argtys,sigptr = sigptrFold (sigptrGetTy ctxt numtypars) ( numparams) bytes sigptr
ILType.FunctionPointer
{ CallingConv=cc
- ArgTypes=mkILTypes argtys
+ ArgTypes = argtys
ReturnType=retty }
,sigptr
elif b0 = et_SENTINEL then failwith "varargs NYI"
@@ -2069,12 +2069,12 @@ and sigptrGetVarArgTys ctxt n numtypars bytes sigptr =
sigptrFold (sigptrGetTy ctxt numtypars) n bytes sigptr
and sigptrGetArgTys ctxt n numtypars bytes sigptr acc =
- if n <= 0 then (mkILTypes (List.rev acc),None),sigptr
+ if n <= 0 then (List.rev acc,None),sigptr
else
let b0,sigptr2 = sigptrGetByte bytes sigptr
if b0 = et_SENTINEL then
let varargs,sigptr = sigptrGetVarArgTys ctxt n numtypars bytes sigptr2
- (mkILTypes (List.rev acc),Some(mkILTypes varargs)),sigptr
+ (List.rev acc,Some(varargs)),sigptr
else
let x,sigptr = sigptrGetTy ctxt numtypars bytes sigptr
sigptrGetArgTys ctxt (n-1) numtypars bytes sigptr (x::acc)
@@ -2136,7 +2136,7 @@ and readBlobHeapAsPropertySigUncached ctxtH (BlobAsPropSigIdx (numtypars,blobIdx
let numparams,sigptr = sigptrGetZInt32 bytes sigptr
let retty,sigptr = sigptrGetTy ctxt numtypars bytes sigptr
let argtys,_sigptr = sigptrFold (sigptrGetTy ctxt numtypars) ( numparams) bytes sigptr
- hasthis,retty,mkILTypes argtys
+ hasthis,retty,argtys
and readBlobHeapAsLocalsSig ctxt numtypars blobIdx =
ctxt.readBlobHeapAsLocalsSig (BlobAsLocalSigIdx (numtypars,blobIdx))
@@ -2177,7 +2177,7 @@ and seekReadMemberRefAsMethodDataUncached ctxtH (MemberRefAsMspecIdx (numtypars,
let nm = readStringHeap ctxt nameIdx
let enclTyp = seekReadMethodRefParent ctxt numtypars mrpIdx
let _generic,genarity,cc,retty,argtys,varargs = readBlobHeapAsMethodSig ctxt enclTyp.GenericArgs.Length typeIdx
- let minst = ILList.init genarity (fun n -> mkILTyvarTy (uint16 (numtypars+n)))
+ let minst = List.init genarity (fun n -> mkILTyvarTy (uint16 (numtypars+n)))
(VarArgMethodData(enclTyp, cc, nm, argtys, varargs,retty,minst))
and seekReadMemberRefAsMethDataNoVarArgs ctxt numtypars idx : MethodData =
@@ -2198,7 +2198,7 @@ and seekReadMethodSpecAsMethodDataUncached ctxtH (MethodSpecAsMspecIdx (numtypar
if ccByte <> e_IMAGE_CEE_CS_CALLCONV_GENERICINST then dprintn ("warning: method inst ILCallingConv was "+string ccByte+" instead of CC_GENERICINST")
let numgpars,sigptr = sigptrGetZInt32 bytes sigptr
let argtys,_sigptr = sigptrFold (sigptrGetTy ctxt numtypars) numgpars bytes sigptr
- mkILTypes argtys
+ argtys
VarArgMethodData(enclTyp, cc, nm, argtys, varargs,retty, minst)
and seekReadMemberRefAsFieldSpec ctxt numtypars idx =
@@ -2238,8 +2238,8 @@ and seekReadMethodDefAsMethodDataUncached ctxtH idx =
let _generic,_genarity,cc,retty,argtys,varargs = readBlobHeapAsMethodSig ctxt 0 typeIdx
if varargs <> None then dprintf "ignoring sentinel and varargs in ILMethodDef token signature"
// Create a formal instantiation if needed
- let finst = mkILFormalGenericArgsRaw (seekReadGenericParams ctxt 0 (tomd_TypeDef,tidx))
- let minst = mkILFormalGenericArgsRaw (seekReadGenericParams ctxt finst.Length (tomd_MethodDef,idx))
+ let finst = mkILFormalGenericArgs (seekReadGenericParams ctxt 0 (tomd_TypeDef,tidx))
+ let minst = mkILFormalGenericArgs (seekReadGenericParams ctxt finst.Length (tomd_MethodDef,idx))
// Read the method def parent.
let enclTyp = seekReadTypeDefAsType ctxt AsObject (* not ok: see note *) finst tidx
// Return the constituent parts: put it together at the place where this is called.
@@ -2266,7 +2266,7 @@ and seekReadFieldDefAsFieldSpecUncached ctxtH idx =
// Read the field signature.
let retty = readBlobHeapAsFieldSig ctxt 0 typeIdx
// Create a formal instantiation if needed
- let finst = mkILFormalGenericArgsRaw (seekReadGenericParams ctxt 0 (tomd_TypeDef,tidx))
+ let finst = mkILFormalGenericArgs (seekReadGenericParams ctxt 0 (tomd_TypeDef,tidx))
// Read the field def parent.
let enclTyp = seekReadTypeDefAsType ctxt AsObject (* not ok: see note *) finst tidx
// Put it together.
@@ -2360,7 +2360,7 @@ and seekReadParams ctxt (retty,argtys) pidx1 pidx2 =
let retRes : ILReturn ref = ref { Marshal=None; Type=retty; CustomAttrs=emptyILCustomAttrs }
let paramsRes : ILParameter [] =
argtys
- |> ILList.toArray
+ |> List.toArray
|> Array.map (fun ty ->
{ Name=None
Default=None
@@ -2372,7 +2372,7 @@ and seekReadParams ctxt (retty,argtys) pidx1 pidx2 =
CustomAttrs=emptyILCustomAttrs })
for i = pidx1 to pidx2 - 1 do
seekReadParamExtras ctxt (retRes,paramsRes) i
- !retRes, ILList.ofArray paramsRes
+ !retRes, List.ofArray paramsRes
and seekReadParamExtras ctxt (retRes,paramsRes) (idx:int) =
let (flags,seq,nameIdx) = seekReadParamRow ctxt idx
@@ -2404,10 +2404,10 @@ and seekReadMethodImpls ctxt numtypars tidx =
mimpls |> List.map (fun (b,c) ->
{ OverrideBy=
let (MethodData(enclTyp, cc, nm, argtys, retty,minst)) = seekReadMethodDefOrRefNoVarargs ctxt numtypars b
- mkILMethSpecInTyRaw (enclTyp, cc, nm, argtys, retty,minst)
+ mkILMethSpecInTy (enclTyp, cc, nm, argtys, retty,minst)
Overrides=
let (MethodData(enclTyp, cc, nm, argtys, retty,minst)) = seekReadMethodDefOrRefNoVarargs ctxt numtypars c
- let mspec = mkILMethSpecInTyRaw (enclTyp, cc, nm, argtys, retty,minst)
+ let mspec = mkILMethSpecInTy (enclTyp, cc, nm, argtys, retty,minst)
OverridesSpec(mspec.MethodRef, mspec.EnclosingType) }))
and seekReadMultipleMethodSemantics ctxt (flags,id) =
@@ -2419,7 +2419,7 @@ and seekReadMultipleMethodSemantics ctxt (flags,id) =
isSorted ctxt TableNames.MethodSemantics,
(fun (a,b,_c) ->
let (MethodData(enclTyp, cc, nm, argtys, retty, minst)) = seekReadMethodDefAsMethodData ctxt b
- a, (mkILMethSpecInTyRaw (enclTyp, cc, nm, argtys, retty, minst)).MethodRef))
+ a, (mkILMethSpecInTy (enclTyp, cc, nm, argtys, retty, minst)).MethodRef))
|> List.filter (fun (flags2,_) -> flags = flags2)
|> List.map snd
@@ -2704,7 +2704,7 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints =
elif !b = (i_constrained &&& 0xff) then
let uncoded = seekReadUncodedToken ctxt.is (start + (!curr))
curr := !curr + 4
- let typ = seekReadTypeDefOrRef ctxt numtypars AsObject ILList.empty (uncodedTokenToTypeDefOrRefOrSpec uncoded)
+ let typ = seekReadTypeDefOrRef ctxt numtypars AsObject [] (uncodedTokenToTypeDefOrRefOrSpec uncoded)
prefixes.constrained <- Some typ
else prefixes.tl <- Tailcall
end
@@ -2781,12 +2781,12 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints =
| ".ctor" -> I_newarr(shape,ty)
| _ -> failwith "bad method on array type"
| _ ->
- let mspec = mkILMethSpecInTyRaw (enclTyp, cc, nm, argtys, retty, minst)
+ let mspec = mkILMethSpecInTy (enclTyp, cc, nm, argtys, retty, minst)
f prefixes (mspec,varargs)
| I_type_instr f ->
let uncoded = seekReadUncodedToken ctxt.is (start + (!curr))
curr := !curr + 4
- let typ = seekReadTypeDefOrRef ctxt numtypars AsObject ILList.empty (uncodedTokenToTypeDefOrRefOrSpec uncoded)
+ let typ = seekReadTypeDefOrRef ctxt numtypars AsObject [] (uncodedTokenToTypeDefOrRefOrSpec uncoded)
f prefixes typ
| I_string_instr f ->
let (tab,idx) = seekReadUncodedToken ctxt.is (start + (!curr))
@@ -2824,11 +2824,11 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints =
let token_info =
if tab = TableNames.Method || tab = TableNames.MemberRef (* REVIEW:generics or tab = TableNames.MethodSpec *) then
let (MethodData(enclTyp, cc, nm, argtys, retty, minst)) = seekReadMethodDefOrRefNoVarargs ctxt numtypars (uncodedTokenToMethodDefOrRef (tab,idx))
- ILToken.ILMethod (mkILMethSpecInTyRaw (enclTyp, cc, nm, argtys, retty, minst))
+ ILToken.ILMethod (mkILMethSpecInTy (enclTyp, cc, nm, argtys, retty, minst))
elif tab = TableNames.Field then
ILToken.ILField (seekReadFieldDefAsFieldSpec ctxt idx)
elif tab = TableNames.TypeDef || tab = TableNames.TypeRef || tab = TableNames.TypeSpec then
- ILToken.ILType (seekReadTypeDefOrRef ctxt numtypars AsObject ILList.empty (uncodedTokenToTypeDefOrRefOrSpec (tab,idx)))
+ ILToken.ILType (seekReadTypeDefOrRef ctxt numtypars AsObject [] (uncodedTokenToTypeDefOrRefOrSpec (tab,idx)))
else failwith "bad token for ldtoken"
f prefixes token_info
| I_sig_instr f ->
@@ -2837,7 +2837,7 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints =
if tab <> TableNames.StandAloneSig then dprintn "strange table for callsig token"
let generic,_genarity,cc,retty,argtys,varargs = readBlobHeapAsMethodSig ctxt numtypars (seekReadStandAloneSigRow ctxt idx)
if generic then failwith "bad image: a generic method signature ctxt.is begin used at a calli instruction"
- f prefixes (mkILCallSigRaw (cc,argtys,retty), varargs)
+ f prefixes (mkILCallSig (cc,argtys,retty), varargs)
| I_switch_instr f ->
let n = (seekReadInt32 ctxt.is (start + (!curr)))
curr := !curr + 4
@@ -2959,7 +2959,7 @@ and seekReadMethodRVA ctxt (idx,nm,_internalcall,noinline,numtypars) rva =
{ IsZeroInit=false
MaxStack= 8
NoInlining=noinline
- Locals=ILList.empty
+ Locals=List.empty
SourceMarker=methRangePdbInfo
Code=code }
@@ -3047,7 +3047,7 @@ and seekReadMethodRVA ctxt (idx,nm,_internalcall,noinline,numtypars) rva =
let handlerFinish = rawToLabel (st2 + sz2)
let clause =
if kind = e_COR_ILEXCEPTION_CLAUSE_EXCEPTION then
- ILExceptionClause.TypeCatch(seekReadTypeDefOrRef ctxt numtypars AsObject ILList.empty (uncodedTokenToTypeDefOrRefOrSpec (i32ToUncodedToken extra)), (handlerStart, handlerFinish) )
+ ILExceptionClause.TypeCatch(seekReadTypeDefOrRef ctxt numtypars AsObject List.empty (uncodedTokenToTypeDefOrRefOrSpec (i32ToUncodedToken extra)), (handlerStart, handlerFinish) )
elif kind = e_COR_ILEXCEPTION_CLAUSE_FILTER then
let filterStart = rawToLabel extra
let filterFinish = handlerStart
@@ -3084,7 +3084,7 @@ and seekReadMethodRVA ctxt (idx,nm,_internalcall,noinline,numtypars) rva =
{ IsZeroInit=initlocals
MaxStack= maxstack
NoInlining=noinline
- Locals=mkILLocals locals
+ Locals = locals
Code=code
SourceMarker=methRangePdbInfo}
else
diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs
index 8f6686f8168..5bcb5d621ea 100644
--- a/src/absil/ilreflect.fs
+++ b/src/absil/ilreflect.fs
@@ -519,9 +519,9 @@ let convCallConv (Callconv (hasThis,basic)) =
let rec convTypeSpec cenv emEnv preferCreated (tspec:ILTypeSpec) =
let typT = convTypeRef cenv emEnv preferCreated tspec.TypeRef
- let tyargs = ILList.map (convTypeAux cenv emEnv preferCreated) tspec.GenericArgs
- match ILList.isEmpty tyargs,typT.IsGenericType with
- | _ ,true -> typT.MakeGenericType(ILList.toArray tyargs) |> nonNull "convTypeSpec: generic"
+ let tyargs = List.map (convTypeAux cenv emEnv preferCreated) tspec.GenericArgs
+ match List.isEmpty tyargs,typT.IsGenericType with
+ | _ ,true -> typT.MakeGenericType(List.toArray tyargs) |> nonNull "convTypeSpec: generic"
| true,false -> typT |> nonNull "convTypeSpec: non generic"
| _ ,false -> failwithf "- convTypeSpec: non-generic type '%O' has type instance of length %d?" typT tyargs.Length
@@ -578,9 +578,9 @@ let convTypeOrTypeDef cenv emEnv typ =
| ILType.Boxed tspec when tspec.GenericArgs.IsEmpty -> convTypeRef cenv emEnv false tspec.TypeRef
| _ -> convType cenv emEnv typ
-let convTypes cenv emEnv (typs:ILTypes) = ILList.map (convType cenv emEnv) typs
+let convTypes cenv emEnv (typs:ILTypes) = List.map (convType cenv emEnv) typs
-let convTypesToArray cenv emEnv (typs:ILTypes) = convTypes cenv emEnv typs |> ILList.toArray
+let convTypesToArray cenv emEnv (typs:ILTypes) = convTypes cenv emEnv typs |> List.toArray
/// Uses the .CreateType() for emitted type if available.
let convCreatedType cenv emEnv typ = convTypeAux cenv emEnv true typ
@@ -692,7 +692,7 @@ let queryableTypeGetMethodBySearch cenv emEnv parentT (mref:ILMethodRef) =
let haveResT = methInfo.ReturnType
(* check for match *)
if argTs.Length <> haveArgTs.Length then false (* method argument length mismatch *) else
- let res = equalTypes resT haveResT && equalTypeLists (ILList.toList argTs) haveArgTs
+ let res = equalTypes resT haveResT && equalTypeLists argTs haveArgTs
res
match List.tryFind select methInfos with
@@ -1262,7 +1262,7 @@ let emitLocal cenv emEnv (ilG : ILGenerator) (local: ILLocal) =
locBuilder
let emitILMethodBody cenv modB emEnv (ilG:ILGenerator) (ilmbody: ILMethodBody) =
- let localBs = Array.map (emitLocal cenv emEnv ilG) (ILList.toArray ilmbody.Locals)
+ let localBs = Array.map (emitLocal cenv emEnv ilG) (List.toArray ilmbody.Locals)
let emEnv = envSetLocals emEnv localBs
emitCode cenv modB emEnv ilG ilmbody.Code
@@ -1307,7 +1307,7 @@ let buildGenParamsPass1b cenv emEnv (genArgs : Type array) (gps : ILGenericParam
let gpB = genpBs.[i]
// the Constraints are either the parent (base) type or interfaces.
let constraintTs = convTypes cenv emEnv gp.Constraints
- let interfaceTs,baseTs = List.partition (fun (typ:System.Type) -> typ.IsInterface) (ILList.toList constraintTs)
+ let interfaceTs,baseTs = List.partition (fun (typ:System.Type) -> typ.IsInterface) constraintTs
// set base type constraint
(match baseTs with
[ ] -> () // Q: should a baseType be set? It is in some samples. Should this be a failure case?
@@ -1496,7 +1496,7 @@ let rec buildMethodPass3 cenv tref modB (typB:TypeBuilder) emEnv (mdef : ILMetho
assert List.isEmpty mdef.GenericParams
// Value parameters
let defineParameter (i,attr,name) = consB.DefineParameterAndLog(i+1,attr,name)
- mdef.Parameters |> ILList.iteri (emitParameter cenv emEnv defineParameter);
+ mdef.Parameters |> List.iteri (emitParameter cenv emEnv defineParameter);
// Body
emitMethodBody cenv modB emEnv consB.GetILGenerator mdef.Name mdef.mdBody;
emitCustomAttrs cenv emEnv (wrapCustomAttr consB.SetCustomAttribute) mdef.CustomAttrs;
@@ -1516,7 +1516,7 @@ let rec buildMethodPass3 cenv tref modB (typB:TypeBuilder) emEnv (mdef : ILMetho
// Value parameters
let defineParameter (i,attr,name) = methB.DefineParameterAndLog(i+1,attr,name)
- mdef.Parameters |> ILList.iteri (fun a b -> emitParameter cenv emEnv defineParameter a b);
+ mdef.Parameters |> List.iteri (fun a b -> emitParameter cenv emEnv defineParameter a b);
// Body
if not isPInvoke then
emitMethodBody cenv modB emEnv methB.GetILGeneratorAndLog mdef.Name mdef.mdBody;
@@ -1757,7 +1757,7 @@ let rec buildTypeDefPass2 cenv nesting emEnv (tdef : ILTypeDef) =
let typB = envGetTypB emEnv tref
let emEnv = envPushTyvars emEnv (getGenericArgumentsOfType (typB.AsType()))
// add interface impls
- tdef.Implements |> convTypes cenv emEnv |> ILList.iter (fun implT -> typB.AddInterfaceImplementationAndLog(implT));
+ tdef.Implements |> convTypes cenv emEnv |> List.iter (fun implT -> typB.AddInterfaceImplementationAndLog(implT));
// add methods, properties
let emEnv = List.fold (buildMethodPass2 cenv tref typB) emEnv tdef.Methods.AsList
let emEnv = List.fold (buildFieldPass2 cenv tref typB) emEnv tdef.Fields.AsList
@@ -1819,8 +1819,8 @@ let rec getTypeRefsInType valueTypesOnly typ acc =
| ILType.Void | ILType.TypeVar _ -> acc
| ILType.Ptr eltType | ILType.Byref eltType -> getTypeRefsInType valueTypesOnly eltType acc
| ILType.Array (_,eltType) -> if valueTypesOnly then acc else getTypeRefsInType valueTypesOnly eltType acc
- | ILType.Value tspec -> tspec.TypeRef :: ILList.foldBack (getTypeRefsInType valueTypesOnly) tspec.GenericArgs acc
- | ILType.Boxed tspec -> if valueTypesOnly then acc else tspec.TypeRef :: ILList.foldBack (getTypeRefsInType valueTypesOnly) tspec.GenericArgs acc
+ | ILType.Value tspec -> tspec.TypeRef :: List.foldBack (getTypeRefsInType valueTypesOnly) tspec.GenericArgs acc
+ | ILType.Boxed tspec -> if valueTypesOnly then acc else tspec.TypeRef :: List.foldBack (getTypeRefsInType valueTypesOnly) tspec.GenericArgs acc
| ILType.FunctionPointer _callsig -> failwith "getTypeRefsInType: fptr"
| ILType.Modified _ -> failwith "getTypeRefsInType: modified"
@@ -1836,9 +1836,9 @@ let createTypeRef (visited : Dictionary<_,_>, created : Dictionary<_,_>) emEnv t
// are resolved overly eagerly by reflection emit's CreateType.
if priority >= 1 then
if verbose2 then dprintf "buildTypeDefPass4: Doing type typar constraints of %s\n" tdef.Name;
- tdef.GenericParams |> List.iter (fun gp -> gp.Constraints |> ILList.iter (traverseType false 2));
+ tdef.GenericParams |> List.iter (fun gp -> gp.Constraints |> List.iter (traverseType false 2));
if verbose2 then dprintf "buildTypeDefPass4: Doing method constraints of %s\n" tdef.Name;
- tdef.Methods.AsList |> List.iter (fun md -> md.GenericParams |> List.iter (fun gp -> gp.Constraints |> ILList.iter (traverseType false 2)));
+ tdef.Methods.AsList |> List.iter (fun md -> md.GenericParams |> List.iter (fun gp -> gp.Constraints |> List.iter (traverseType false 2)));
// We absolutely need the parent type...
if priority >= 1 then
@@ -1848,13 +1848,13 @@ let createTypeRef (visited : Dictionary<_,_>, created : Dictionary<_,_>) emEnv t
// We absolutely need the interface types...
if priority >= 1 then
if verbose2 then dprintf "buildTypeDefPass4: Creating Interface Chain of %s\n" tdef.Name;
- tdef.Implements |> ILList.iter (traverseType false priority);
+ tdef.Implements |> List.iter (traverseType false priority);
// We have to define all struct types in all methods before a class is defined. This only has any effect when there is a struct type
// being defined simultaneously with this type.
if priority >= 1 then
if verbose2 then dprintf "buildTypeDefPass4: Doing value types in method signatures of %s\n" tdef.Name
- tdef.Methods |> Seq.iter (fun md -> md.Parameters |> ILList.iter (fun p -> p.Type |> (traverseType true 1))
+ tdef.Methods |> Seq.iter (fun md -> md.Parameters |> List.iter (fun p -> p.Type |> (traverseType true 1))
md.Return.Type |> traverseType true 1);
if priority >= 1 then
diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs
index 966de947a05..79033a3a2ea 100644
--- a/src/absil/ilwrite.fs
+++ b/src/absil/ilwrite.fs
@@ -507,7 +507,7 @@ type MethodDefKey(tidx:int,garity:int,nm:string,rty:ILType,argtys:ILTypes,isStat
nm = y.Name &&
// note: these next two use structural equality on AbstractIL ILType values
rty = y.ReturnType &&
- ILList.lengthsEqAndForall2 (fun a b -> a = b) argtys y.ArgTypes &&
+ List.lengthsEqAndForall2 (fun a b -> a = b) argtys y.ArgTypes &&
isStatic = y.IsStatic
| _ -> false
@@ -828,7 +828,7 @@ let callconvToByte ntypars (Callconv (hasthis,bcc)) =
// REVIEW: write into an accumuating buffer
let rec EmitTypeSpec cenv env (bb: ByteBuffer) (et,tspec:ILTypeSpec) =
- if ILList.isEmpty tspec.GenericArgs then
+ if List.isEmpty tspec.GenericArgs then
bb.EmitByte et
emitTypeInfoAsTypeDefOrRefEncoded cenv bb (tspec.Scope,tspec.Enclosing,tspec.Name)
else
@@ -842,7 +842,7 @@ and GetTypeAsTypeDefOrRef cenv env (ty:ILType) =
if isTypeLocal ty then
let tref = ty.TypeRef
(tdor_TypeDef, GetIdxForTypeDef cenv (TdKey(tref.Enclosing,tref.Name)))
- elif ty.IsNominal && ILList.isEmpty ty.GenericArgs then
+ elif ty.IsNominal && List.isEmpty ty.GenericArgs then
(tdor_TypeRef, GetTypeRefAsTypeRefIdx cenv ty.TypeRef)
else
(tdor_TypeSpec, GetTypeAsTypeSpecIdx cenv env ty)
@@ -925,20 +925,20 @@ and EmitCallsig cenv env bb (callconv,args:ILTypes,ret,varargs:ILVarArgs,genarit
if genarity > 0 then bb.EmitZ32 genarity
bb.EmitZ32 ((args.Length + (match varargs with None -> 0 | Some l -> l.Length)))
EmitType cenv env bb ret
- args |> ILList.iter (EmitType cenv env bb)
+ args |> List.iter (EmitType cenv env bb)
match varargs with
| None -> ()// no extra arg = no sentinel
| Some tys ->
- if ILList.isEmpty tys then () // no extra arg = no sentinel
+ if List.isEmpty tys then () // no extra arg = no sentinel
else
bb.EmitByte et_SENTINEL
- ILList.iter (EmitType cenv env bb) tys
+ List.iter (EmitType cenv env bb) tys
and GetCallsigAsBytes cenv env x = emitBytesViaBuffer (fun bb -> EmitCallsig cenv env bb x)
// REVIEW: write into an accumuating buffer
and EmitTypes cenv env bb (inst: ILTypes) =
- inst |> ILList.iter (EmitType cenv env bb)
+ inst |> List.iter (EmitType cenv env bb)
let GetTypeAsMemberRefParent cenv env ty =
match GetTypeAsTypeDefOrRef cenv env ty with
@@ -1220,7 +1220,7 @@ and GenTypeDefPass2 pidx enc cenv (td:ILTypeDef) =
// Now generate or assign index numbers for tables referenced by the maps.
// Don't yet generate contents of these tables - leave that to pass3, as
// code may need to embed these entries.
- td.Implements |> ILList.iter (GenImplementsPass2 cenv env tidx)
+ td.Implements |> List.iter (GenImplementsPass2 cenv env tidx)
props |> List.iter (GenPropertyDefPass2 cenv tidx)
events |> List.iter (GenEventDefPass2 cenv tidx)
td.Fields.AsList |> List.iter (GenFieldDefPass2 cenv tidx)
@@ -1310,7 +1310,7 @@ let GetMethodRefInfoAsMemberRefIdx cenv env ((_,typ,_,_,_,_,_) as minfo) =
let GetMethodRefInfoAsMethodRefOrDef isAlwaysMethodDef cenv env ((nm,typ:ILType,cc,args,ret,varargs,genarity) as minfo) =
if Option.isNone varargs && (isAlwaysMethodDef || isTypeLocal typ) then
if not typ.IsNominal then failwith "GetMethodRefInfoAsMethodRefOrDef: unexpected local tref-typ"
- try (mdor_MethodDef, GetMethodRefAsMethodDefIdx cenv (mkILMethRefRaw(typ.TypeRef, cc, nm, genarity, args,ret)))
+ try (mdor_MethodDef, GetMethodRefAsMethodDefIdx cenv (mkILMethRef (typ.TypeRef, cc, nm, genarity, args,ret)))
with MethodDefNotFound -> (mdor_MemberRef, GetMethodRefInfoAsMemberRefIdx cenv env minfo)
else (mdor_MemberRef, GetMethodRefInfoAsMemberRefIdx cenv env minfo)
@@ -1325,7 +1325,7 @@ let rec GetMethodSpecInfoAsMethodSpecIdx cenv env (nm,typ,cc,args,ret,varargs,mi
emitBytesViaBuffer (fun bb ->
bb.EmitByte e_IMAGE_CEE_CS_CALLCONV_GENERICINST
bb.EmitZ32 minst.Length
- minst |> ILList.iter (EmitType cenv env bb))
+ minst |> List.iter (EmitType cenv env bb))
FindOrAddSharedRow cenv TableNames.MethodSpec
(SharedRow
[| MethodDefOrRef (mdorTag,mdorRow)
@@ -1502,7 +1502,7 @@ let GetCallsigAsStandAloneSigIdx cenv env info =
let EmitLocalSig cenv env (bb: ByteBuffer) (locals: ILLocals) =
bb.EmitByte e_IMAGE_CEE_CS_CALLCONV_LOCAL_SIG
bb.EmitZ32 locals.Length
- locals |> ILList.iter (EmitLocalInfo cenv env bb)
+ locals |> List.iter (EmitLocalInfo cenv env bb)
let GetLocalSigAsBlobHeapIdx cenv env locals =
GetBytesAsBlobIdx cenv (emitBytesViaBuffer (fun bb -> EmitLocalSig cenv env bb locals))
@@ -2027,22 +2027,22 @@ module Codebuf =
if (shape = ILArrayShape.SingleDimensional) then
emitTypeInstr cenv codebuf env i_newarr ty
else
- let args = ILList.init shape.Rank (fun _ -> cenv.ilg.typ_int32)
- emitMethodSpecInfoInstr cenv codebuf env i_newobj (".ctor",mkILArrTy(ty,shape),ILCallingConv.Instance,args,ILType.Void,None,emptyILGenericArgs)
+ let args = List.init shape.Rank (fun _ -> cenv.ilg.typ_int32)
+ emitMethodSpecInfoInstr cenv codebuf env i_newobj (".ctor",mkILArrTy(ty,shape),ILCallingConv.Instance,args,ILType.Void,None,[])
| I_stelem_any (shape,ty) ->
if (shape = ILArrayShape.SingleDimensional) then
emitTypeInstr cenv codebuf env i_stelem_any ty
else
- let args = ILList.init (shape.Rank+1) (fun i -> if i < shape.Rank then cenv.ilg.typ_int32 else ty)
- emitMethodSpecInfoInstr cenv codebuf env i_call ("Set",mkILArrTy(ty,shape),ILCallingConv.Instance,args,ILType.Void,None,emptyILGenericArgs)
+ let args = List.init (shape.Rank+1) (fun i -> if i < shape.Rank then cenv.ilg.typ_int32 else ty)
+ emitMethodSpecInfoInstr cenv codebuf env i_call ("Set",mkILArrTy(ty,shape),ILCallingConv.Instance,args,ILType.Void,None,[])
| I_ldelem_any (shape,ty) ->
if (shape = ILArrayShape.SingleDimensional) then
emitTypeInstr cenv codebuf env i_ldelem_any ty
else
- let args = ILList.init shape.Rank (fun _ -> cenv.ilg.typ_int32)
- emitMethodSpecInfoInstr cenv codebuf env i_call ("Get",mkILArrTy(ty,shape),ILCallingConv.Instance,args,ty,None,emptyILGenericArgs)
+ let args = List.init shape.Rank (fun _ -> cenv.ilg.typ_int32)
+ emitMethodSpecInfoInstr cenv codebuf env i_call ("Get",mkILArrTy(ty,shape),ILCallingConv.Instance,args,ty,None,[])
| I_ldelema (ro,_isNativePtr,shape,ty) ->
if (ro = ReadonlyAddress) then
@@ -2050,8 +2050,8 @@ module Codebuf =
if (shape = ILArrayShape.SingleDimensional) then
emitTypeInstr cenv codebuf env i_ldelema ty
else
- let args = ILList.init shape.Rank (fun _ -> cenv.ilg.typ_int32)
- emitMethodSpecInfoInstr cenv codebuf env i_call ("Address",mkILArrTy(ty,shape),ILCallingConv.Instance,args,ILType.Byref ty,None,emptyILGenericArgs)
+ let args = List.init shape.Rank (fun _ -> cenv.ilg.typ_int32)
+ emitMethodSpecInfoInstr cenv codebuf env i_call ("Address",mkILArrTy(ty,shape),ILCallingConv.Instance,args,ILType.Byref ty,None,[])
| I_castclass ty -> emitTypeInstr cenv codebuf env i_castclass ty
| I_isinst ty -> emitTypeInstr cenv codebuf env i_isinst ty
@@ -2241,7 +2241,7 @@ let GetFieldDefTypeAsBlobIdx cenv env ty =
let GenILMethodBody mname cenv env (il: ILMethodBody) =
let localSigs =
if cenv.generatePdb then
- il.Locals |> ILList.toArray |> Array.map (fun l ->
+ il.Locals |> List.toArray |> Array.map (fun l ->
// Write a fake entry for the local signature headed by e_IMAGE_CEE_CS_CALLCONV_FIELD. This is referenced by the PDB file
ignore (FindOrAddSharedRow cenv TableNames.StandAloneSig (SharedRow [| Blob (GetFieldDefTypeAsBlobIdx cenv env l.Type) |]))
// Now write the type
@@ -2253,7 +2253,7 @@ let GenILMethodBody mname cenv env (il: ILMethodBody) =
let codeSize = code.Length
let methbuf = ByteBuffer.Create (codeSize * 3)
// Do we use the tiny format?
- if ILList.isEmpty il.Locals && il.MaxStack <= 8 && List.isEmpty seh && codeSize < 64 then
+ if List.isEmpty il.Locals && il.MaxStack <= 8 && List.isEmpty seh && codeSize < 64 then
// Use Tiny format
let alignedCodeSize = align 4 (codeSize + 1)
let codePadding = (alignedCodeSize - (codeSize + 1))
@@ -2270,7 +2270,7 @@ let GenILMethodBody mname cenv env (il: ILMethodBody) =
(if il.IsZeroInit then e_CorILMethod_InitLocals else 0x0uy)
let localToken =
- if ILList.isEmpty il.Locals then 0x0 else
+ if List.isEmpty il.Locals then 0x0 else
getUncodedToken TableNames.StandAloneSig
(FindOrAddSharedRow cenv TableNames.StandAloneSig (GetLocalSigAsStandAloneSigIdx cenv env il.Locals))
@@ -2443,7 +2443,7 @@ and GenGenericParamPass3 cenv env idx owner gp =
and GenGenericParamPass4 cenv env idx owner gp =
let gpidx = FindOrAddSharedRow cenv TableNames.GenericParam (GetGenericParamAsGenericParamRow cenv env idx owner gp)
GenCustomAttrsPass3Or4 cenv (hca_GenericParam, gpidx) gp.CustomAttrs
- gp.Constraints |> ILList.iter (GenGenericParamConstraintPass4 cenv env gpidx)
+ gp.Constraints |> List.iter (GenGenericParamConstraintPass4 cenv env gpidx)
// --------------------------------------------------------------------
// param and return --> Param Row
@@ -2504,7 +2504,7 @@ let GetMethodDefSigAsBytes cenv env (mdef: ILMethodDef) =
if mdef.GenericParams.Length > 0 then bb.EmitZ32 mdef.GenericParams.Length
bb.EmitZ32 mdef.Parameters.Length
EmitType cenv env bb mdef.Return.Type
- mdef.ParameterTypes |> ILList.iter (EmitType cenv env bb))
+ mdef.ParameterTypes |> List.iter (EmitType cenv env bb))
let GenMethodDefSigAsBlobIdx cenv env mdef =
GetBytesAsBlobIdx cenv (GetMethodDefSigAsBytes cenv env mdef)
@@ -2603,7 +2603,7 @@ let GenMethodDefPass3 cenv env (md:ILMethodDef) =
let idx2 = AddUnsharedRow cenv TableNames.Method (GenMethodDefAsRow cenv env midx md)
if midx <> idx2 then failwith "index of method def on pass 3 does not match index on pass 2"
GenReturnPass3 cenv md.Return
- md.Parameters |> ILList.iteri (fun n param -> GenParamPass3 cenv env (n+1) param)
+ md.Parameters |> List.iteri (fun n param -> GenParamPass3 cenv env (n+1) param)
md.CustomAttrs |> GenCustomAttrsPass3Or4 cenv (hca_MethodDef,midx)
md.SecurityDecls.AsList |> GenSecurityDeclsPass3 cenv (hds_MethodDef,midx)
md.GenericParams |> List.iteri (fun n gp -> GenGenericParamPass3 cenv env n (tomd_MethodDef, midx) gp)
@@ -2666,7 +2666,7 @@ and GetPropertySigAsBytes cenv env prop =
bb.EmitByte b
bb.EmitZ32 prop.Args.Length
EmitType cenv env bb prop.Type
- prop.Args |> ILList.iter (EmitType cenv env bb))
+ prop.Args |> List.iter (EmitType cenv env bb))
and GetPropertyAsPropertyRow cenv env (prop:ILPropertyDef) =
let flags =
diff --git a/src/absil/ilx.fs b/src/absil/ilx.fs
index b0ea4fdd779..bb8de7ea3ec 100644
--- a/src/absil/ilx.fs
+++ b/src/absil/ilx.fs
@@ -109,7 +109,7 @@ type IlxClosureSpec =
member x.GenericArgs = let (IlxClosureSpec(_,inst,_)) = x in inst
static member Create (cloref, inst) =
let (IlxClosureRef(tref,_,_)) = cloref
- IlxClosureSpec(cloref, inst, mkILBoxedType (mkILTySpecRaw(tref, inst)))
+ IlxClosureSpec(cloref, inst, mkILBoxedType (mkILTySpec (tref, inst)))
member clospec.Constructor =
let cloTy = clospec.ILType
let fields = clospec.FormalFreeVars
@@ -143,7 +143,7 @@ type IlxUnionInfo =
let destTyFuncApp = function Apps_tyapp (b,c) -> b,c | _ -> failwith "destTyFuncApp"
-let mkILFormalCloRef gparams csig = IlxClosureSpec.Create(csig, mkILFormalGenericArgsRaw gparams)
+let mkILFormalCloRef gparams csig = IlxClosureSpec.Create(csig, mkILFormalGenericArgs gparams)
let actualTypOfIlxUnionField (cuspec : IlxUnionSpec) idx fidx =
instILType cuspec.GenericArgs (cuspec.FieldDef idx fidx).Type
diff --git a/src/absil/zmap.fs b/src/absil/zmap.fs
index 0e91c66eca0..141f1a0de64 100644
--- a/src/absil/zmap.fs
+++ b/src/absil/zmap.fs
@@ -42,7 +42,6 @@ module internal Zmap =
m.Fold (fun k v s -> match f k v with None -> s | Some x -> x::s) []
let ofList m xs = List.fold (fun m (k,v) -> add k v m) (empty m) xs
- let ofFlatList m xs = FlatList.fold (fun m (k,v) -> add k v m) (empty m) xs
let keys m = chooseL (fun k _ -> Some k) m
let values m = chooseL (fun _ v -> Some v) m
diff --git a/src/absil/zmap.fsi b/src/absil/zmap.fsi
index a6f0acabe30..e2e81388b11 100644
--- a/src/absil/zmap.fsi
+++ b/src/absil/zmap.fsi
@@ -39,8 +39,7 @@ module internal Zmap =
val chooseL : ('Key -> 'T -> 'U option) -> Zmap<'Key,'T> -> 'U list
val toList : Zmap<'Key,'T> -> ('Key * 'T) list
- val ofList : IComparer<'Key> -> ('Key * 'T) list -> Zmap<'Key,'T>
- val ofFlatList : IComparer<'Key> -> FlatList<'Key * 'T> -> Zmap<'Key,'T>
+ val ofList : IComparer<'Key> -> ('Key * 'T) list -> Zmap<'Key,'T>
val keys : Zmap<'Key,'T> -> 'Key list
val values : Zmap<'Key,'T> -> 'T list
diff --git a/src/absil/zset.fs b/src/absil/zset.fs
index 9d0faae67b8..6d6f9b9b175 100644
--- a/src/absil/zset.fs
+++ b/src/absil/zset.fs
@@ -22,7 +22,6 @@ module internal Zset =
let contains x (s:Zset<_>) = s.Contains(x)
let add x (s:Zset<_>) = s.Add(x)
let addList xs a = List.fold (fun a x -> add x a) a xs
- let addFlatList xs a = FlatList.fold (fun a x -> add x a) a xs
let singleton ord x = add x (empty ord)
let remove x (s:Zset<_>) = s.Remove(x)
diff --git a/src/absil/zset.fsi b/src/absil/zset.fsi
index 90eba6dc159..92e85c854bf 100644
--- a/src/absil/zset.fsi
+++ b/src/absil/zset.fsi
@@ -20,7 +20,6 @@ module internal Zset =
val memberOf : Zset<'T> -> 'T -> bool
val add : 'T -> Zset<'T> -> Zset<'T>
val addList : 'T list -> Zset<'T> -> Zset<'T>
- val addFlatList : FlatList<'T> -> Zset<'T> -> Zset<'T>
val singleton : IComparer<'T> -> 'T -> Zset<'T>
val remove : 'T -> Zset<'T> -> Zset<'T>
diff --git a/src/fsharp/DetupleArgs.fs b/src/fsharp/DetupleArgs.fs
index d680760d040..beb3a8e25f4 100644
--- a/src/fsharp/DetupleArgs.fs
+++ b/src/fsharp/DetupleArgs.fs
@@ -226,15 +226,15 @@ module GlobalUsageAnalysis =
/// Log the definition of a non-recursive binding
let logNonRecBinding z (bind:Binding) =
let v = bind.Var
- let vs = FlatList.one v
+ let vs = [v]
{z with RecursiveBindings = Zmap.add v (false,vs) z.RecursiveBindings
Defns = Zmap.add v bind.Expr z.Defns }
/// Log the definition of a recursive binding
let logRecBindings z binds =
let vs = valsOfBinds binds
- {z with RecursiveBindings = (z.RecursiveBindings,vs) ||> FlatList.fold (fun mubinds v -> Zmap.add v (true,vs) mubinds)
- Defns = (z.Defns,binds) ||> FlatList.fold (fun eqns bind -> Zmap.add bind.Var bind.Expr eqns) }
+ {z with RecursiveBindings = (z.RecursiveBindings,vs) ||> List.fold (fun mubinds v -> Zmap.add v (true,vs) mubinds)
+ Defns = (z.Defns,binds) ||> List.fold (fun eqns bind -> Zmap.add bind.Var bind.Expr eqns) }
/// Work locally under a lambda of some kind
let foldUnderLambda f z x =
@@ -810,7 +810,7 @@ let passBind penv (TBind(fOrig,repr,letSeqPtOpt) as bind) =
// result
bind
-let passBinds penv binds = binds |> FlatList.map (passBind penv)
+let passBinds penv binds = binds |> List.map (passBind penv)
//-------------------------------------------------------------------------
// pass - passBindRhs
@@ -828,7 +828,7 @@ let passBindRhs conv (TBind (v,repr,letSeqPtOpt)) = TBind(v,conv repr,letSeqPtOp
let preInterceptExpr (penv:penv) conv expr =
match expr with
| Expr.LetRec (binds,e,m,_) ->
- let binds = FlatList.map (passBindRhs conv) binds
+ let binds = List.map (passBindRhs conv) binds
let binds = passBinds penv binds
Some (mkLetRecBinds m binds (conv e))
| Expr.Let (bind,e,m,_) ->
diff --git a/src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj b/src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj
index 4886c9db278..8689c4d9dac 100644
--- a/src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj
+++ b/src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj
@@ -107,9 +107,6 @@
TaggedCollections.fs
-
- FlatList.fs
-
Utilities\ildiag.fsi
diff --git a/src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj b/src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj
index da37aa76f7d..4ae1551a54d 100644
--- a/src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj
+++ b/src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj
@@ -93,9 +93,6 @@
Utilities\TaggedCollections.fs
-
- Utilities\FlatList.fs
-
Utilities\ildiag.fsi
diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs
index 9c2eae6437e..e13d5d01962 100644
--- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs
+++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs
@@ -299,6 +299,28 @@ type AsyncModule() =
Assert.IsTrue(isSet())
for _i = 1 to 3 do test()
+ []
+ member this.``OnCancel.RaceBetweenCancellationAndDispose``() =
+ let flag = ref 0
+ let cts = new System.Threading.CancellationTokenSource()
+ let go = async {
+ use disp =
+ cts.Cancel()
+ { new IDisposable with
+ override __.Dispose() = incr flag }
+ while true do
+ do! Async.Sleep 50
+ }
+ try
+ Async.RunSynchronously (go, cancellationToken = cts.Token)
+ with
+#if FX_NO_OPERATION_CANCELLED
+ _ -> ()
+#else
+ :? System.OperationCanceledException -> ()
+#endif
+ Assert.AreEqual(1, !flag)
+
[]
member this.``OnCancel.CancelThatWasSignalledBeforeRunningTheComputation``() =
let test() =
diff --git a/src/fsharp/FSharp.Core/control.fs b/src/fsharp/FSharp.Core/control.fs
index 6f58a8c47e0..88798702646 100644
--- a/src/fsharp/FSharp.Core/control.fs
+++ b/src/fsharp/FSharp.Core/control.fs
@@ -909,7 +909,11 @@ namespace Microsoft.FSharp.Control
/// Implement use/Dispose
let usingA (r:'T :> IDisposable) (f:'T -> Async<'a>) : Async<'a> =
- tryFinallyA (fun () -> Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions.Dispose r) (callA f r)
+ let mutable x = 0
+ let disposeFunction _ =
+ if Interlocked.CompareExchange(&x, 1, 0) = 0 then
+ Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions.Dispose r
+ tryFinallyA disposeFunction (callA f r) |> whenCancelledA disposeFunction
let ignoreA p =
bindA p (fun _ -> doneA)
diff --git a/src/fsharp/FSharp.LanguageService.Compiler/FSharp.LanguageService.Compiler.fsproj b/src/fsharp/FSharp.LanguageService.Compiler/FSharp.LanguageService.Compiler.fsproj
index 394c76e7fa7..0a58d2d9e6f 100644
--- a/src/fsharp/FSharp.LanguageService.Compiler/FSharp.LanguageService.Compiler.fsproj
+++ b/src/fsharp/FSharp.LanguageService.Compiler/FSharp.LanguageService.Compiler.fsproj
@@ -97,9 +97,6 @@
Utilities\TaggedCollections.fs
-
- Utilities\FlatList.fs
-
Utilities\QueueList.fs
diff --git a/src/fsharp/FindUnsolved.fs b/src/fsharp/FindUnsolved.fs
index 0635dc3c189..dd74bfd8bd8 100644
--- a/src/fsharp/FindUnsolved.fs
+++ b/src/fsharp/FindUnsolved.fs
@@ -148,7 +148,7 @@ and accLambdas cenv env topValInfo e ety =
accExpr cenv env e
and accExprs cenv env exprs = exprs |> List.iter (accExpr cenv env)
-and accFlatExprs cenv env exprs = exprs |> FlatList.iter (accExpr cenv env)
+and accFlatExprs cenv env exprs = exprs |> List.iter (accExpr cenv env)
and accTargets cenv env m ty targets = Array.iter (accTarget cenv env m ty) targets
and accTarget cenv env _m _ty (TTarget(_vs,e,_)) = accExpr cenv env e
@@ -198,7 +198,7 @@ and accBind cenv env (bind:Binding) =
let topValInfo = match bind.Var.ValReprInfo with Some info -> info | _ -> ValReprInfo.emptyValData
accLambdas cenv env topValInfo bind.Expr bind.Var.Type
-and accBinds cenv env xs = xs |> FlatList.iter (accBind cenv env)
+and accBinds cenv env xs = xs |> List.iter (accBind cenv env)
//--------------------------------------------------------------------------
// check tycons
diff --git a/src/fsharp/FlatList.fs b/src/fsharp/FlatList.fs
deleted file mode 100644
index 66e0f056b7c..00000000000
--- a/src/fsharp/FlatList.fs
+++ /dev/null
@@ -1,281 +0,0 @@
-// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-namespace Internal.Utilities
-
-open System.Collections
-open System.Collections.Generic
-
-//-------------------------------------------------------------------------
-// Library: flat list (immutable arrays)
-//------------------------------------------------------------------------
-#if FLAT_LIST_AS_ARRAY_STRUCT
-//#else
-[]
-type internal FlatList<'T> =
- val internal array : 'T[]
- internal new (arr: 'T[]) = { array = (match arr with null -> null | arr -> if arr.Length = 0 then null else arr) }
- member x.Item with get(n:int) = x.array.[n]
- member x.Length = match x.array with null -> 0 | arr -> arr.Length
- member x.IsEmpty = match x.array with null -> true | _ -> false
- static member Empty : FlatList<'T> = FlatList(null)
- interface IEnumerable<'T> with
- member x.GetEnumerator() : IEnumerator<'T> =
- match x.array with
- | null -> Seq.empty.GetEnumerator()
- | arr -> (arr :> IEnumerable<'T>).GetEnumerator()
- interface IEnumerable with
- member x.GetEnumerator() : IEnumerator =
- match x.array with
- | null -> (Seq.empty :> IEnumerable).GetEnumerator()
- | arr -> (arr :> IEnumerable).GetEnumerator()
-
-
-[]
-module internal FlatList =
-
- let empty<'T> = FlatList<'T>.Empty
-
- let collect (f: 'T -> FlatList<'T>) (x:FlatList<_>) =
- match x.array with
- | null -> FlatList.Empty
- | arr ->
- if arr.Length = 1 then f arr.[0]
- else FlatList(Array.map (fun x -> match (f x).array with null -> [| |] | arr -> arr) arr |> Array.concat)
-
- let exists f (x:FlatList<_>) =
- match x.array with
- | null -> false
- | arr -> Array.exists f arr
-
- let filter f (x:FlatList<_>) =
- match x.array with
- | null -> FlatList.Empty
- | arr -> FlatList(Array.filter f arr)
-
- let fold f acc (x:FlatList<_>) =
- match x.array with
- | null -> acc
- | arr -> Array.fold f acc arr
-
- let fold2 f acc (x:FlatList<_>) (y:FlatList<_>) =
- match x.array,y.array with
- | null,null -> acc
- | null,_ | _,null -> invalidArg "x" "mismatched list lengths"
- | arr1,arr2 -> Array.fold2 f acc arr1 arr2
-
- let foldBack f (x:FlatList<_>) acc =
- match x.array with
- | null -> acc
- | arr -> Array.foldBack f arr acc
-
- let foldBack2 f (x:FlatList<_>) (y:FlatList<_>) acc =
- match x.array,y.array with
- | null,null -> acc
- | null,_ | _,null -> invalidArg "x" "mismatched list lengths"
- | arr1,arr2 -> Array.foldBack2 f arr1 arr2 acc
-
- let map2 f (x:FlatList<_>) (y:FlatList<_>) =
- match x.array,y.array with
- | null,null -> FlatList.Empty
- | null,_ | _,null -> invalidArg "x" "mismatched list lengths"
- | arr1,arr2 -> FlatList(Array.map2 f arr1 arr2)
-
- let forall f (x:FlatList<_>) =
- match x.array with
- | null -> true
- | arr -> Array.forall f arr
-
- let forall2 f (x1:FlatList<_>) (x2:FlatList<_>) =
- match x1.array, x2.array with
- | null,null -> true
- | null,_ | _,null -> invalidArg "x1" "mismatched list lengths"
- | arr1,arr2 -> Array.forall2 f arr1 arr2
-
- let iter2 f (x1:FlatList<_>) (x2:FlatList<_>) =
- match x1.array, x2.array with
- | null,null -> ()
- | null,_ | _,null -> invalidArg "x1" "mismatched list lengths"
- | arr1,arr2 -> Array.iter2 f arr1 arr2
-
- let partition f (x:FlatList<_>) =
- match x.array with
- | null -> FlatList.Empty,FlatList.Empty
- | arr ->
- let arr1,arr2 = Array.partition f arr
- FlatList(arr1),FlatList(arr2)
-
- let (* inline *) sum (x:FlatList) =
- match x.array with
- | null -> 0
- | arr -> Array.sum arr
-
- let (* inline *) sumBy (f: 'T -> int) (x:FlatList<'T>) =
- match x.array with
- | null -> 0
- | arr -> Array.sumBy f arr
-
- let unzip (x:FlatList<_>) =
- match x.array with
- | null -> FlatList.Empty,FlatList.Empty
- | arr -> let arr1,arr2 = Array.unzip arr in FlatList(arr1),FlatList(arr2)
-
- let physicalEquality (x:FlatList<_>) (y:FlatList<_>) =
- LanguagePrimitives.PhysicalEquality x.array y.array
-
- let tryFind f (x:FlatList<_>) =
- match x.array with
- | null -> None
- | arr -> Array.tryFind f arr
-
- let concat (x:FlatList<_>) =
- match x.array with
- | null -> FlatList.Empty
- | arr -> FlatList(Array.concat arr)
-
- let isEmpty (x:FlatList<_>) = x.IsEmpty
- let one(x) = FlatList([| x |])
-
- let toMap (x:FlatList<_>) = match x.array with null -> Map.empty | arr -> Map.ofArray arr
- let length (x:FlatList<_>) = x.Length
-
- let map f (x:FlatList<_>) =
- match x.array with
- | null -> FlatList.Empty
- | arr -> FlatList(Array.map f arr)
-
- let mapi f (x:FlatList<_>) =
- match x.array with
- | null -> FlatList.Empty
- | arr -> FlatList(Array.mapi f arr)
-
- let iter f (x:FlatList<_>) =
- match x.array with
- | null -> ()
- | arr -> Array.iter f arr
-
- let iteri f (x:FlatList<_>) =
- match x.array with
- | null -> ()
- | arr -> Array.iteri f arr
-
- let toList (x:FlatList<_>) =
- match x.array with
- | null -> []
- | arr -> Array.toList arr
-
- let append(l1 : FlatList<'T>) (l2 : FlatList<'T>) =
- match l1.array, l2.array with
- | null,_ -> l2
- | _,null -> l1
- | arr1, arr2 -> FlatList(Array.append arr1 arr2)
-
- let ofSeq l =
- FlatList(Array.ofSeq l)
-
- let ofList l =
- match l with
- | [] -> FlatList.Empty
- | l -> FlatList(Array.ofList l)
-
- let init n f =
- if n = 0 then
- FlatList.Empty
- else
- FlatList(Array.init n f)
-
- let zip (x:FlatList<_>) (y:FlatList<_>) =
- match x.array,y.array with
- | null,null -> FlatList.Empty
- | null,_ | _,null -> invalidArg "x" "mismatched list lengths"
- | arr1,arr2 -> FlatList(Array.zip arr1 arr2)
-
-#endif
-#if FLAT_LIST_AS_LIST
-
-#else
-type internal FlatList<'T> ='T list
-
-[]
-module internal FlatList =
- let empty<'T> : 'T list = []
- let inline collect (f: 'T -> FlatList<'T>) (x:FlatList<_>) = List.collect f x
- let inline exists f (x:FlatList<_>) = List.exists f x
- let inline filter f (x:FlatList<_>) = List.filter f x
- let inline fold f acc (x:FlatList<_>) = List.fold f acc x
- let inline fold2 f acc (x:FlatList<_>) (y:FlatList<_>) = List.fold2 f acc x y
- let inline foldBack f (x:FlatList<_>) acc = List.foldBack f x acc
- let inline foldBack2 f (x:FlatList<_>) (y:FlatList<_>) acc = List.foldBack2 f x y acc
- let inline map2 f (x:FlatList<_>) (y:FlatList<_>) = List.map2 f x y
- let inline forall f (x:FlatList<_>) = List.forall f x
- let inline forall2 f (x1:FlatList<_>) (x2:FlatList<_>) = List.forall2 f x1 x2
- let inline iter2 f (x1:FlatList<_>) (x2:FlatList<_>) = List.iter2 f x1 x2
- let inline partition f (x:FlatList<_>) = List.partition f x
- let inline sum (x:FlatList) = List.sum x
- let inline sumBy (f: 'T -> int) (x:FlatList<'T>) = List.sumBy f x
- let inline unzip (x:FlatList<_>) = List.unzip x
- let inline physicalEquality (x:FlatList<_>) (y:FlatList<_>) = (LanguagePrimitives.PhysicalEquality x y)
- let inline tryFind f (x:FlatList<_>) = List.tryFind f x
- let inline concat (x:FlatList<_>) = List.concat x
- let inline isEmpty (x:FlatList<_>) = List.isEmpty x
- let inline one(x) = [x]
- let inline toMap (x:FlatList<_>) = Map.ofList x
- let inline length (x:FlatList<_>) = List.length x
- let inline map f (x:FlatList<_>) = List.map f x
- let inline mapi f (x:FlatList<_>) = List.mapi f x
- let inline iter f (x:FlatList<_>) = List.iter f x
- let inline iteri f (x:FlatList<_>) = List.iteri f x
- let inline toList (x:FlatList<_>) = x
- let inline ofSeq (x:seq<_>) = List.ofSeq x
- let inline append(l1 : FlatList<'T>) (l2 : FlatList<'T>) = List.append l1 l2
- let inline ofList(l) = l
- let inline init n f = List.init n f
- let inline zip (x:FlatList<_>) (y:FlatList<_>) = List.zip x y
-#endif
-
-#if FLAT_LIST_AS_ARRAY
-//#else
-type internal FlatList<'T> ='T array
-
-type internal FlatListEmpty<'T>() =
- // cache the empty array in a generic static field
- static let empty : 'T array = [| |]
- static member Empty : 'T array = empty
-
-[]
-module internal FlatList =
- let empty<'T> : 'T array = FlatListEmpty<'T>.Empty
- //let empty<'T> : 'T array = [| |]
- let collect (f: 'T -> FlatList<'T>) (x:FlatList<_>) = x |> Array.map f |> Array.concat
- let exists f x = Array.exists f x
- let filter f x = Array.filter f x
- let fold f acc x = Array.fold f acc x
- let fold2 f acc x y = Array.fold2 f acc x y
- let foldBack f x acc = Array.foldBack f x acc
- let foldBack2 f x y acc = Array.foldBack2 f x y acc
- let map2 f x y = Array.map2 f x y
- let forall f x = Array.forall f x
- let forall2 f x1 x2 = Array.forall2 f x1 x2
- let iter2 f x1 x2 = Array.iter2 f x1 x2
- let partition f x = Array.partition f x
- let (* inline *) sum (x:FlatList) = Array.sum x
- let (* inline *) sumBy (f: 'T -> int) (x:FlatList<'T>) = Array.sumBy f x
- let unzip x = Array.unzip x
- let physicalEquality (x:FlatList<_>) (y:FlatList<_>) = LanguagePrimitives.PhysicalEquality x y
- let tryFind f x = Array.tryFind f x
- let concat x = Array.concat x
- let isEmpty x = Array.isEmpty x
- let one x = [| x |]
- let toMap x = Map.ofArray x
- let length x = Array.length x
- let map f x = Array.map f x
- let mapi f x = Array.mapi f x
- let iter f x = Array.iter f x
- let iteri f x = Array.iteri f x
- let toList x = Array.toList x
- let append l1 l2 = Array.append l1 l2
- let ofSeq l = Array.ofSeq l
- let ofList l = Array.ofList l
- let init n f = Array.init n f
- let zip x y = Array.zip x y
-#endif
-
diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs
index eec92b5b07c..7192b9777fa 100644
--- a/src/fsharp/IlxGen.fs
+++ b/src/fsharp/IlxGen.fs
@@ -62,9 +62,9 @@ let mkLdfldMethodDef (ilMethName,reprAccess,isStatic,ilTy,ilFieldName,ilPropType
let ilReturn = mkILReturn ilPropType
let ilMethodDef =
if isStatic then
- mkILNonGenericStaticMethod (ilMethName,reprAccess,[],ilReturn,mkMethodBody(true,emptyILLocals,2,nonBranchingInstrsToCode [mkNormalLdsfld ilFieldSpec],None))
+ mkILNonGenericStaticMethod (ilMethName,reprAccess,[],ilReturn,mkMethodBody(true,[],2,nonBranchingInstrsToCode [mkNormalLdsfld ilFieldSpec],None))
else
- mkILNonGenericInstanceMethod (ilMethName,reprAccess,[],ilReturn,mkMethodBody (true,emptyILLocals,2,nonBranchingInstrsToCode [ mkLdarg0; mkNormalLdfld ilFieldSpec],None))
+ mkILNonGenericInstanceMethod (ilMethName,reprAccess,[],ilReturn,mkMethodBody (true,[],2,nonBranchingInstrsToCode [ mkLdarg0; mkNormalLdfld ilFieldSpec],None))
ilMethodDef |> AddSpecialNameFlag
let ChooseParamNames fieldNamesAndTypes =
@@ -399,7 +399,7 @@ and GenTyAppAux amap m g tyenv repr tinst =
match repr with
| CompiledTypeRepr.ILAsmOpen ty ->
let ilTypeInst = GenTypeArgsAux amap m g tyenv tinst
- let ty = IL.instILType (ILList.ofList ilTypeInst) ty
+ let ty = IL.instILType ilTypeInst ty
ty
| CompiledTypeRepr.ILAsmNamed (tref, boxity, ilTypeOpt) ->
match ilTypeOpt with
@@ -498,7 +498,7 @@ and ComputeUnionHasHelpers g (tcref : TyconRef) =
and GenUnionSpec amap m g tyenv tcref tyargs =
let curef = GenUnionRef amap m g tcref
let tinst = GenTypeArgs amap m g tyenv tyargs
- IlxUnionSpec(curef,mkILGenericArgs tinst)
+ IlxUnionSpec(curef,tinst)
and GenUnionCaseSpec amap m g tyenv (ucref:UnionCaseRef) tyargs =
let cuspec = GenUnionSpec amap m g tyenv ucref.TyconRef tyargs
@@ -1003,7 +1003,7 @@ and AddBindingsForModule allocVal cloc x eenv =
AddBindingsForModuleDef allocVal cloc eenv mdef
and AddBindingsForModuleTopVals _g allocVal _cloc eenv vs =
- FlatList.foldBack allocVal vs eenv
+ List.foldBack allocVal vs eenv
// Put the partial results for a generated fragment (i.e. a part of a CCU generated by FSI)
@@ -1129,7 +1129,7 @@ type TypeDefBuilder(tdef, tdefDiscards) =
member b.PrependInstructionsToSpecificMethodDef(cond,instrs,tag) =
match ResizeArray.tryFindIndex cond gmethods with
| Some idx -> gmethods.[idx] <- prependInstrsToMethod instrs gmethods.[idx]
- | None -> gmethods.Add(mkILClassCtor (mkMethodBody (false,emptyILLocals,1,nonBranchingInstrsToCode instrs,tag)))
+ | None -> gmethods.Add(mkILClassCtor (mkMethodBody (false,[],1,nonBranchingInstrsToCode instrs,tag)))
and TypeDefsBuilder() =
@@ -1619,7 +1619,7 @@ let CodeGenMethod cenv mgbuf (zapFirstSeqPointToStart,entryPointInfo,methodName,
let maxStack = maxStack + 2
// Build an Abstract IL method
- instrs, mkILMethodBody (true,mkILLocals locals,maxStack,code, sourceRange)
+ instrs, mkILMethodBody (true,locals,maxStack,code, sourceRange)
let StartDelayedLocalScope nm cgbuf =
let startScope = CG.GenerateDelayMark cgbuf ("start_" + nm)
@@ -1691,7 +1691,7 @@ let rec FirstEmittedCodeWillBeSequencePoint g sp expr =
(BindingEmitsNoCode g bind && FirstEmittedCodeWillBeSequencePoint g sp body)
| Expr.LetRec(binds,body,_,_) ->
binds |> List.exists (BindingEmitsSequencePoint g) ||
- (binds |> FlatList.forall (BindingEmitsNoCode g) && FirstEmittedCodeWillBeSequencePoint g sp body)
+ (binds |> List.forall (BindingEmitsNoCode g) && FirstEmittedCodeWillBeSequencePoint g sp body)
| Expr.Sequential (_, _, NormalSeq,spSeq,_) ->
match spSeq with
| SequencePointsAtSeq -> true
@@ -1720,7 +1720,7 @@ let AlwaysSuppressSequencePoint g sp expr =
// We suppress sequence points at invisible let bindings even if they are requested by SPAlways.
| Expr.Let (bind,_,_,_) when bindIsInvisible bind -> true
- | Expr.LetRec(binds,_,_,_) when (binds |> FlatList.exists bindHasSeqPt) || (binds |> FlatList.forall bindIsInvisible) -> true
+ | Expr.LetRec(binds,_,_,_) when (binds |> List.exists bindHasSeqPt) || (binds |> List.forall bindIsInvisible) -> true
// We always suppress at sequential where the sequence point is missing. We need to document better why.
| Expr.Sequential _ -> true
@@ -2579,7 +2579,7 @@ and GenApp cenv cgbuf eenv (f,fty,tyargs,args,m) sequel =
let isTailCall =
if List.isEmpty laterArgs && not isSelfInit then
let isDllImport = IsValRefIsDllImport cenv.g vref
- let hasByrefArg = mspec.FormalArgTypes |> ILList.exists (function ILType.Byref _ -> true | _ -> false)
+ let hasByrefArg = mspec.FormalArgTypes |> List.exists (function ILType.Byref _ -> true | _ -> false)
let makesNoCriticalTailcalls = vref.MakesNoCriticalTailcalls
CanTailcall((boxity=AsValue),ccallInfo,eenv.withinSEH,hasByrefArg,mustGenerateUnitAfterCall,isDllImport,isSelfInit,makesNoCriticalTailcalls,sequel)
else Normalcall
@@ -3242,7 +3242,7 @@ and GenQuotation cenv cgbuf eenv (ast,conv,m,ety) sequel =
//--------------------------------------------------------------------------
and GenILCall cenv cgbuf eenv (virt,valu,newobj,valUseFlags,isDllImport,ilMethRef:ILMethodRef,enclArgTys,methArgTys,argExprs,returnTys,m) sequel =
- let hasByrefArg = ilMethRef.ArgTypes |> ILList.exists IsILTypeByref
+ let hasByrefArg = ilMethRef.ArgTypes |> List.exists IsILTypeByref
let isSuperInit = match valUseFlags with CtorValUsedAsSuperInit -> true | _ -> false
let isBaseCall = match valUseFlags with VSlotDirectCall -> true | _ -> false
let ccallInfo = match valUseFlags with PossibleConstrainedCall ty -> Some ty | _ -> None
@@ -3406,7 +3406,7 @@ and GenGenericParam cenv eenv (tp:Typar) =
else
nm
- Constraints=mkILTypes subTypeConstraints
+ Constraints = subTypeConstraints
Variance=NonVariant
CustomAttrs = mkILCustomAttrs (GenAttrs cenv eenv tp.Attribs)
HasReferenceTypeConstraint=refTypeConstraint
@@ -3458,12 +3458,12 @@ and GenMethodImpl cenv eenv (useMethodImpl,(TSlotSig(nameOfOverridenMethod,_,_,_
nameOfOverridingMethod,
(fun (ilTyForOverriding,methTyparsOfOverridingMethod) ->
let ilOverrideTyRef = ilOverrideTy.TypeRef
- let ilOverrideMethRef = mkILMethRef(ilOverrideTyRef, ILCallingConv.Instance, nameOfOverridenMethod, List.length (DropErasedTypars methTyparsOfOverridingMethod), (typesOfILParamsList ilOverrideParams), ilOverrideRet.Type)
+ let ilOverrideMethRef = mkILMethRef(ilOverrideTyRef, ILCallingConv.Instance, nameOfOverridenMethod, List.length (DropErasedTypars methTyparsOfOverridingMethod), (typesOfILParams ilOverrideParams), ilOverrideRet.Type)
let eenvForOverrideBy = AddTyparsToEnv methTyparsOfOverridingMethod eenv
let ilParamsOfOverridingMethod,ilReturnOfOverridingMethod = GenActualSlotsig m cenv eenvForOverrideBy slotsig methTyparsOfOverridingMethod
let ilOverrideMethGenericParams = GenGenericParams cenv eenvForOverrideBy methTyparsOfOverridingMethod
let ilOverrideMethGenericArgs = mkILFormalGenericArgs ilOverrideMethGenericParams
- let ilOverrideBy = mkILInstanceMethSpecInTy(ilTyForOverriding, nameOfOverridingMethod, typesOfILParamsList ilParamsOfOverridingMethod, ilReturnOfOverridingMethod.Type, ilOverrideMethGenericArgs)
+ let ilOverrideBy = mkILInstanceMethSpecInTy(ilTyForOverriding, nameOfOverridingMethod, typesOfILParams ilParamsOfOverridingMethod, ilReturnOfOverridingMethod.Type, ilOverrideMethGenericArgs)
{ Overrides = OverridesSpec(ilOverrideMethRef,ilOverrideTy)
OverrideBy = ilOverrideBy })
@@ -3546,7 +3546,7 @@ and GenObjectExpr cenv cgbuf eenvouter expr (baseType,baseValOpt,basecall,overri
let ilCloGenericActuals = cloinfo.cloSpec.GenericArgs
let ilCloRetTy = cloinfo.cloILFormalRetTy
let ilCloTypeRef = cloinfo.cloSpec.TypeRef
- let ilTyForOverriding = mkILBoxedTyRaw ilCloTypeRef ilCloGenericActuals
+ let ilTyForOverriding = mkILBoxedTy ilCloTypeRef ilCloGenericActuals
let eenvinner = bindBaseOrThisVarOpt cenv eenvinner baseValOpt
let ilCtorBody = CodeGenMethodForExpr cenv cgbuf.mgbuf (SPAlways,[],cloName,eenvinner,1,0,basecall,discardAndReturnVoid)
@@ -3606,8 +3606,8 @@ and GenSequenceExpr cenv (cgbuf:CodeGenBuffer) eenvouter (nextEnumeratorValRef:V
let ilCloTyInner = mkILFormalBoxedTy ilCloTypeRef ilCloGenericParams
let ilCloLambdas = Lambdas_return ilCloRetTyInner
let cloref = IlxClosureRef(ilCloTypeRef, ilCloLambdas, ilCloFreeVars)
- let ilxCloSpec = IlxClosureSpec.Create(cloref, mkILGenericArgs ( GenGenericArgs m eenvouter.tyenv cloFreeTyvars))
- let formalClospec = IlxClosureSpec.Create(cloref, mkILFormalGenericArgsRaw ilCloGenericParams)
+ let ilxCloSpec = IlxClosureSpec.Create(cloref, GenGenericArgs m eenvouter.tyenv cloFreeTyvars)
+ let formalClospec = IlxClosureSpec.Create(cloref, mkILFormalGenericArgs ilCloGenericParams)
let getFreshMethod =
let _,mbody =
@@ -3701,7 +3701,7 @@ and GenClosureTypeDefs cenv (tref:ILTypeRef, ilGenParams, attrs, ilCloFreeVars,
IsSpecialName= true
NestedTypes=emptyILTypeDefs
Encoding= ILDefaultPInvokeEncoding.Auto
- Implements= mkILTypes ilIntfTys
+ Implements = ilIntfTys
Extends= Some ext
SecurityDecls= emptyILSecurityDecls
HasSecurity=false }
@@ -3757,13 +3757,13 @@ and GenLambdaClosure cenv (cgbuf:CodeGenBuffer) eenv isLocalTypeFunc selfv expr
IsSpecialName= true
NestedTypes=emptyILTypeDefs
Encoding= ILDefaultPInvokeEncoding.Auto
- Implements= mkILTypes []
+ Implements = []
Extends= Some cenv.g.ilg.typ_Object
SecurityDecls= emptyILSecurityDecls
HasSecurity=false }
cgbuf.mgbuf.AddTypeDef(ilContractTypeRef, ilContractTypeDef, false, false, None)
- let ilCtorBody = mkILMethodBody (true,emptyILLocals,8,nonBranchingInstrsToCode (mkCallBaseConstructor(ilContractTy,[])), None )
+ let ilCtorBody = mkILMethodBody (true,[],8,nonBranchingInstrsToCode (mkCallBaseConstructor(ilContractTy,[])), None )
let cloMethods = [ mkILGenericVirtualMethod("DirectInvoke",ILMemberAccess.Assembly,cloinfo.localTypeFuncDirectILGenericParams,[],mkILReturn (cloinfo.cloILFormalRetTy), MethodBody.IL ilCloBody) ]
let cloTypeDefs = GenClosureTypeDefs cenv (ilCloTypeRef,cloinfo.cloILGenericParams,[],cloinfo.cloILFreeVars,cloinfo.ilCloLambdas,ilCtorBody,cloMethods,[],ilContractTy,[])
cloTypeDefs
@@ -4010,7 +4010,7 @@ and GetIlxClosureInfo cenv m isLocalTypeFunc selfv eenvouter expr =
[],ilReturnTy,ilCloLambdas
- let ilxCloSpec = IlxClosureSpec.Create(IlxClosureRef(ilCloTypeRef, ilCloLambdas, ilCloFreeVars), mkILGenericArgs ilCloGenericActuals)
+ let ilxCloSpec = IlxClosureSpec.Create(IlxClosureRef(ilCloTypeRef, ilCloLambdas, ilCloFreeVars), ilCloGenericActuals)
let cloinfo =
{ cloExpr=expr
cloName=ilCloTypeRef.Name
@@ -4067,7 +4067,7 @@ and GenDelegateExpr cenv cgbuf eenvouter expr (TObjExprMethod((TSlotSig(_,delega
let _,_,tdef = tcref.ILTyconInfo
match tdef.Methods.FindByName ".ctor" with
| [ctorMDef] ->
- match ctorMDef.Parameters |> ILList.toList with
+ match ctorMDef.Parameters with
| [ _;p2 ] -> (p2.Type.TypeSpec.Name = "System.UIntPtr")
| _ -> false
| _ -> false
@@ -4112,12 +4112,12 @@ and GenDelegateExpr cenv cgbuf eenvouter expr (TObjExprMethod((TSlotSig(_,delega
CountClosure()
let ctxtGenericArgsForDelegee = GenGenericArgs m eenvouter.tyenv cloFreeTyvars
- let ilxCloSpec = IlxClosureSpec.Create(IlxClosureRef(ilDelegeeTypeRef, ilCloLambdas, ilCloFreeVars), mkILGenericArgs ctxtGenericArgsForDelegee)
+ let ilxCloSpec = IlxClosureSpec.Create(IlxClosureRef(ilDelegeeTypeRef, ilCloLambdas, ilCloFreeVars), ctxtGenericArgsForDelegee)
GenGetLocalVals cenv cgbuf eenvouter m cloFreeVars
CG.EmitInstr cgbuf (pop ilCloFreeVars.Length) (Push [EraseClosures.mkTyOfLambdas cenv.g.ilxPubCloEnv ilCloLambdas]) (I_newobj (ilxCloSpec.Constructor,None))
let ilDelegeeTyOuter = mkILBoxedTy ilDelegeeTypeRef ctxtGenericArgsForDelegee
- let ilDelegeeInvokeMethOuter = mkILNonGenericInstanceMethSpecInTy (ilDelegeeTyOuter,"Invoke",typesOfILParamsList ilDelegeeParams, ilDelegeeRet.Type)
+ let ilDelegeeInvokeMethOuter = mkILNonGenericInstanceMethSpecInTy (ilDelegeeTyOuter,"Invoke",typesOfILParams ilDelegeeParams, ilDelegeeRet.Type)
let ilDelegeeCtorMethOuter = mkCtorMethSpecForDelegate cenv.g.ilg (ilCtxtDelTy,useUIntPtrForDelegateCtor)
CG.EmitInstr cgbuf (pop 0) (Push [cenv.g.ilg.typ_IntPtr]) (I_ldftn ilDelegeeInvokeMethOuter)
CG.EmitInstr cgbuf (pop 2) (Push [ilCtxtDelTy]) (I_newobj(ilDelegeeCtorMethOuter,None))
@@ -4283,7 +4283,7 @@ and GenDecisionTreeSuccess cenv cgbuf inplabOpt stackAtTargets eenv es targetIdx
// If not binding anything we can go directly to the targetMarkAfterBinds point
// This is useful to avoid lots of branches e.g. in match A | B | C -> e
// In this case each case will just go straight to "e"
- if FlatList.isEmpty vs then
+ if List.isEmpty vs then
match inplabOpt with
| None -> CG.EmitInstr cgbuf (pop 0) Push0 (I_br targetMarkAfterBinds.CodeLabel)
| Some inplab -> CG.SetMark cgbuf inplab targetMarkAfterBinds
@@ -4293,8 +4293,8 @@ and GenDecisionTreeSuccess cenv cgbuf inplabOpt stackAtTargets eenv es targetIdx
// It would be better not to emit any expressions here, and instead push these assignments into the postponed target
// However not all targets are currently postponed (we only postpone in debug code), pending further testing of the performance
// impact of postponing.
- (vs,es) ||> FlatList.iter2 (GenBindRhs cenv cgbuf eenv SPSuppress)
- vs |> List.rev |> FlatList.iter (fun v -> GenStoreVal cgbuf eenvAtTarget v.Range v)
+ (vs,es) ||> List.iter2 (GenBindRhs cenv cgbuf eenv SPSuppress)
+ vs |> List.rev |> List.iter (fun v -> GenStoreVal cgbuf eenvAtTarget v.Range v)
CG.EmitInstr cgbuf (pop 0) Push0 (I_br targetMarkAfterBinds.CodeLabel)
targetInfos
@@ -4337,7 +4337,7 @@ and GenDecisionTreeTarget cenv cgbuf stackAtTargets _targetIdx (targetMarkBefore
//
// Only repeat the sequence point if we really have to, i.e. if the target expression doesn't start with a
// sequence point anyway
- if FlatList.isEmpty vs && DoesGenExprStartWithSequencePoint cenv.g spExpr successExpr then
+ if List.isEmpty vs && DoesGenExprStartWithSequencePoint cenv.g spExpr successExpr then
()
else
match spTarget with
@@ -4494,7 +4494,7 @@ and GenDecisionTreeTest cenv cloc cgbuf stackAtTargets e tester eenv successTree
// This comes up in the generated equality functions. REVIEW: do this as a peephole optimization elsewhere
| TDSuccess(es1,n1),
TDSuccess(es2,n2) when
- FlatList.isEmpty es1 && FlatList.isEmpty es2 &&
+ List.isEmpty es1 && List.isEmpty es2 &&
(match GetTarget targets n1, GetTarget targets n2 with
| TTarget(_,BoolExpr(b1),_),TTarget(_,BoolExpr(b2),_) -> b1 = not b2
| _ -> false) ->
@@ -4552,7 +4552,7 @@ and GenLetRecFixup cenv cgbuf eenv (ilxCloSpec:IlxClosureSpec,e,ilField:ILFieldS
and GenLetRecBinds cenv cgbuf eenv (allBinds: Bindings,m) =
(* Fix up recursion for non-toplevel recursive bindings *)
let bindsPossiblyRequiringFixup =
- allBinds |> FlatList.filter (fun b ->
+ allBinds |> List.filter (fun b ->
match (StorageForVal m b.Var eenv) with
| StaticProperty _
| Method _
@@ -4581,9 +4581,9 @@ and GenLetRecBinds cenv cgbuf eenv (allBinds: Bindings,m) =
let fixups = ref []
- let recursiveVars = Zset.addFlatList (bindsPossiblyRequiringFixup |> FlatList.map (fun v -> v.Var)) (Zset.empty valOrder)
+ let recursiveVars = Zset.addList (bindsPossiblyRequiringFixup |> List.map (fun v -> v.Var)) (Zset.empty valOrder)
let _ =
- (recursiveVars, bindsPossiblyRequiringFixup) ||> FlatList.fold (fun forwardReferenceSet (bind:Binding) ->
+ (recursiveVars, bindsPossiblyRequiringFixup) ||> List.fold (fun forwardReferenceSet (bind:Binding) ->
// Compute fixups
bind.Expr |> IterateRecursiveFixups cenv.g (Some bind.Var)
(computeFixupsForOneRecursiveVar bind.Var forwardReferenceSet fixups)
@@ -4595,7 +4595,7 @@ and GenLetRecBinds cenv cgbuf eenv (allBinds: Bindings,m) =
// Generate the actual bindings
let _ =
- (recursiveVars, allBinds) ||> FlatList.fold (fun forwardReferenceSet (bind:Binding) ->
+ (recursiveVars, allBinds) ||> List.fold (fun forwardReferenceSet (bind:Binding) ->
GenBind cenv cgbuf eenv bind
// Record the variable as defined
let forwardReferenceSet = Zset.remove bind.Var forwardReferenceSet
@@ -4610,7 +4610,7 @@ and GenLetRec cenv cgbuf eenv (binds,body,m) sequel =
let eenv = AllocStorageForBinds cenv cgbuf scopeMarks eenv binds
GenLetRecBinds cenv cgbuf eenv (binds,m)
- let sp = if FlatList.exists (BindingEmitsSequencePoint cenv.g) binds then SPAlways else SPSuppress
+ let sp = if List.exists (BindingEmitsSequencePoint cenv.g) binds then SPAlways else SPSuppress
GenExpr cenv cgbuf eenv sp body (EndLocalScope(sequel,endScope))
//-------------------------------------------------------------------------
@@ -4685,7 +4685,7 @@ and GenBindAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) =
CallingConv = ILThisConvention.Static
Type = ilTy
Init = None
- Args = mkILTypes []
+ Args = []
CustomAttrs = mkILCustomAttrs ilAttribs }
cgbuf.mgbuf.AddOrMergePropertyDef(ilGetterMethSpec.MethodRef.EnclosingTypeRef, ilPropDef,m)
@@ -4763,19 +4763,19 @@ and GenBindAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) =
CallingConv=ILThisConvention.Static
Type=fty
Init=None
- Args= mkILTypes []
+ Args = []
CustomAttrs=mkILCustomAttrs (ilAttribs @ [mkCompilationMappingAttr cenv.g (int SourceConstructFlags.Value)]) }
cgbuf.mgbuf.AddOrMergePropertyDef(ilTypeRefForProperty,ilPropDef,m)
let getterMethod =
mkILStaticMethod([],ilGetterMethRef.Name,access,[],mkILReturn fty,
- mkMethodBody(true,emptyILLocals,2,nonBranchingInstrsToCode [ mkNormalLdsfld fspec ],None))
+ mkMethodBody(true,[],2,nonBranchingInstrsToCode [ mkNormalLdsfld fspec ],None))
|> AddSpecialNameFlag
cgbuf.mgbuf.AddMethodDef(ilTypeRefForProperty,getterMethod)
if mut || cenv.opts.isInteractiveItExpr then
let setterMethod =
mkILStaticMethod([],ilSetterMethRef.Name,access,[mkILParamNamed("value",fty)],mkILReturn ILType.Void,
- mkMethodBody(true,emptyILLocals,2,nonBranchingInstrsToCode [ mkLdarg0;mkNormalStsfld fspec],None))
+ mkMethodBody(true,[],2,nonBranchingInstrsToCode [ mkLdarg0;mkNormalStsfld fspec],None))
|> AddSpecialNameFlag
cgbuf.mgbuf.AddMethodDef(ilTypeRefForProperty,setterMethod)
@@ -4937,10 +4937,10 @@ and GenParamAttribs cenv attribs =
inFlag,outFlag,optionalFlag,Marshal,attribs
and GenParams cenv eenv (mspec:ILMethodSpec) (attribs:ArgReprInfo list) (implValsOpt: Val list option) =
- let ilArgTys = mspec.FormalArgTypes |> ILList.toList
+ let ilArgTys = mspec.FormalArgTypes
let argInfosAndTypes =
- if attribs.Length = ilArgTys.Length then List.zip ilArgTys attribs
- else ilArgTys |> List.map (fun ilArgTy -> ilArgTy,ValReprInfo.unnamedTopArg1)
+ if List.length attribs = List.length ilArgTys then List.zip ilArgTys attribs
+ else ilArgTys |> List.map (fun ilArgTy -> ilArgTy,ValReprInfo.unnamedTopArg1)
let argInfosAndTypes =
match implValsOpt with
@@ -4997,7 +4997,7 @@ and GenPropertyForMethodDef compileAsInstance tref mdef (v:Val) (memberInfo:ValM
CallingConv=(if compileAsInstance then ILThisConvention.Instance else ILThisConvention.Static)
Type=ilPropTy
Init=None
- Args= mkILTypes ilArgTys
+ Args = ilArgTys
CustomAttrs=ilAttrs }
and GenEventForProperty cenv eenvForMeth (mspec:ILMethodSpec) (v:Val) ilAttrsThatGoOnPrimaryItem m returnTy =
@@ -5333,7 +5333,7 @@ and GenPInvokeMethod (nm,dll,namedArgs) =
CharBestFit=if (decoder.FindBool "BestFitMapping" false) then PInvokeCharBestFit.Enabled else PInvokeCharBestFit.UseAssembly }
-and GenBindings cenv cgbuf eenv binds = FlatList.iter (GenBind cenv cgbuf eenv) binds
+and GenBindings cenv cgbuf eenv binds = List.iter (GenBind cenv cgbuf eenv) binds
//-------------------------------------------------------------------------
// Generate locals and other storage of values
@@ -5516,16 +5516,15 @@ and AllocLocalVal cenv cgbuf v eenv repr scopeMarks =
Some repr, eenv
and AllocStorageForBind cenv cgbuf scopeMarks eenv bind =
- AllocStorageForBinds cenv cgbuf scopeMarks eenv (FlatList.one bind)
-
+ AllocStorageForBinds cenv cgbuf scopeMarks eenv [bind]
and AllocStorageForBinds cenv cgbuf scopeMarks eenv binds =
- // phase 1 - decicde representations - most are very simple.
- let reps, eenv = FlatList.mapFold (AllocValForBind cenv cgbuf scopeMarks) eenv binds
+ // phase 1 - decide representations - most are very simple.
+ let reps, eenv = List.mapFold (AllocValForBind cenv cgbuf scopeMarks) eenv binds
// Phase 2 - run the cloinfo generators for NamedLocalClosure values against the environment recording the
// representation choices.
- reps |> FlatList.iter (fun reprOpt ->
+ reps |> List.iter (fun reprOpt ->
match reprOpt with
| Some repr ->
match repr with
@@ -5690,7 +5689,7 @@ and GenAttr amap g eenv (Attrib(_,k,args,props,_,_,_)) =
assert(vref.IsMember)
let mspec,_,_,_,_ = GetMethodSpecForMemberVal amap g (Option.get vref.MemberInfo) vref
mspec
- let ilArgs = List.map2 (fun (AttribExpr(_,vexpr)) ty -> GenAttribArg amap g eenv vexpr ty) args (ILList.toList mspec.FormalArgTypes)
+ let ilArgs = List.map2 (fun (AttribExpr(_,vexpr)) ty -> GenAttribArg amap g eenv vexpr ty) args mspec.FormalArgTypes
mkILCustomAttribMethRef g.ilg (mspec,ilArgs, props)
and GenAttrs cenv eenv attrs = List.map (GenAttr cenv.amap cenv.g eenv) attrs
@@ -5772,7 +5771,7 @@ and GenModuleDef cenv (cgbuf:CodeGenBuffer) qname lazyInitInfo eenv x =
mbinds |> List.iter (GenModuleBinding cenv cgbuf qname lazyInitInfo eenv m)
| TMDefLet(bind,_) ->
- GenBindings cenv cgbuf eenv (FlatList.one bind)
+ GenBindings cenv cgbuf eenv [bind]
| TMDefDo(e,_) ->
GenExpr cenv cgbuf eenv SPAlways e discard
@@ -5987,7 +5986,7 @@ and GenEqualsOverrideCallingIComparable cenv (tcref:TyconRef, ilThisTy, _ilThatT
("Equals",ILMemberAccess.Public,
[mkILParamNamed ("obj",cenv.g.ilg.typ_Object)],
mkILReturn cenv.g.ilg.typ_bool,
- mkMethodBody(true,emptyILLocals,2,
+ mkMethodBody(true,[],2,
nonBranchingInstrsToCode
[ yield mkLdarg0
yield mkLdarg 1us
@@ -6326,7 +6325,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) =
CallingConv = ilCallingConv.ThisConv
Type = ilPropType
Init = None
- Args = mkILTypes []
+ Args = []
CustomAttrs = mkILCustomAttrs ilFieldAttrs } ]
let methodDefs =
@@ -6352,11 +6351,11 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) =
if isStatic then
mkILNonGenericStaticMethod
(ilMethName,iLAccess,ilParams,ilReturn,
- mkMethodBody(true,emptyILLocals,2,nonBranchingInstrsToCode ([ mkLdarg0;mkNormalStsfld ilFieldSpec]),None))
+ mkMethodBody(true,[],2,nonBranchingInstrsToCode ([ mkLdarg0;mkNormalStsfld ilFieldSpec]),None))
else
mkILNonGenericInstanceMethod
(ilMethName,iLAccess,ilParams,ilReturn,
- mkMethodBody(true,emptyILLocals,2,nonBranchingInstrsToCode ([ mkLdarg0;mkLdarg 1us;mkNormalStfld ilFieldSpec]),None))
+ mkMethodBody(true,[],2,nonBranchingInstrsToCode ([ mkLdarg0;mkLdarg 1us;mkNormalStfld ilFieldSpec]),None))
yield ilMethodDef |> AddSpecialNameFlag
if generateDebugDisplayAttribute then
@@ -6382,7 +6381,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) =
let ilMethodDef = mkILNonGenericInstanceMethod (debugDisplayMethodName,ILMemberAccess.Assembly,[],
mkILReturn cenv.g.ilg.typ_Object,
mkMethodBody
- (true,emptyILLocals,2,
+ (true,[],2,
nonBranchingInstrsToCode
([ // load the hardwired format string
yield I_ldstr "%+0.8A"
@@ -6619,7 +6618,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) =
IsSpecialName= false
NestedTypes=emptyILTypeDefs
Encoding= ILDefaultPInvokeEncoding.Auto
- Implements= mkILTypes ilIntfTys
+ Implements = ilIntfTys
Extends= Some (if tycon.IsStructOrEnumTycon then cenv.g.ilg.typ_ValueType else cenv.g.ilg.typ_Object)
SecurityDecls= emptyILSecurityDecls
HasSecurity=false }
@@ -6687,7 +6686,7 @@ and GenExnDef cenv mgbuf eenv m (exnc:Tycon) =
CallingConv=ILThisConvention.Instance
Type=ilPropType
Init=None
- Args=mkILTypes []
+ Args = []
CustomAttrs=mkILCustomAttrs (GenAttrs cenv eenv fld.PropertyAttribs @ [mkCompilationMappingAttrWithSeqNum cenv.g (int SourceConstructFlags.Field) i]) }
yield (ilMethodDef,ilFieldDef,ilPropDef,(ilPropName,ilFieldName,ilPropType)) ]
|> List.unzip4
@@ -6713,7 +6712,7 @@ and GenExnDef cenv mgbuf eenv m (exnc:Tycon) =
mkILCtor(ILMemberAccess.Family,
[mkILParamNamed("info", serializationInfoType);mkILParamNamed("context",cenv.g.ilg.typ_StreamingContext)],
mkMethodBody
- (false,emptyILLocals,8,
+ (false,[],8,
nonBranchingInstrsToCode
[ mkLdarg0
mkLdarg 1us
@@ -6738,7 +6737,7 @@ and GenExnDef cenv mgbuf eenv m (exnc:Tycon) =
mkLdarg 2us
mkNormalCall (mkILNonGenericInstanceMethSpecInTy (cenv.g.ilg.typ_Exception, "GetObjectData", [serializationInfoType; cenv.g.ilg.typ_StreamingContext], ILType.Void))
]
- mkMethodBody(true,emptyILLocals,8,code,None)))
+ mkMethodBody(true,[],8,code,None)))
// Here we must encode: [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
// In ILDASM this is: .permissionset demand = {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SerializationFormatter' = bool(true)}}
match cenv.g.ilg.tref_SecurityPermissionAttribute with
diff --git a/src/fsharp/InnerLambdasToTopLevelFuncs.fs b/src/fsharp/InnerLambdasToTopLevelFuncs.fs
index 447896a1a7e..b8b1d0d4717 100644
--- a/src/fsharp/InnerLambdasToTopLevelFuncs.fs
+++ b/src/fsharp/InnerLambdasToTopLevelFuncs.fs
@@ -210,7 +210,7 @@ module Pass1_DetermineTLRAndArities =
let hasDelayedRepr f = isDelayedRepr f (Zmap.force f xinfo.Defns ("IsValueRecursionFree - hasDelayedRepr",nameOfVal))
let isRecursive,mudefs = Zmap.force f xinfo.RecursiveBindings ("IsValueRecursionFree",nameOfVal)
- not isRecursive || FlatList.forall hasDelayedRepr mudefs
+ not isRecursive || List.forall hasDelayedRepr mudefs
let DumpArity arityM =
let dump f n = dprintf "tlr: arity %50s = %d\n" (showL (valL f)) n
@@ -304,19 +304,19 @@ module Pass1_DetermineTLRAndArities =
/// [Each fclass has an env, the fclass are the handles to envs.]
type BindingGroupSharingSameReqdItems(bindings: Bindings) =
let vals = valsOfBinds bindings
- let vset = Zset.addFlatList vals (Zset.empty valOrder)
+ let vset = Zset.addList vals (Zset.empty valOrder)
member fclass.Vals = vals
member fclass.Contains (v: Val) = vset.Contains v
- member fclass.IsEmpty = FlatList.isEmpty vals
+ member fclass.IsEmpty = List.isEmpty vals
- member fclass.Pairs = vals |> FlatList.map (fun f -> (f,fclass))
+ member fclass.Pairs = vals |> List.map (fun f -> (f,fclass))
- override fclass.ToString() = "+" + String.concat "+" (FlatList.map nameOfVal vals)
+ override fclass.ToString() = "+" + String.concat "+" (List.map nameOfVal vals)
-let fclassOrder = Order.orderOn (fun (b: BindingGroupSharingSameReqdItems) -> b.Vals) (FlatList.order valOrder)
+let fclassOrder = Order.orderOn (fun (b: BindingGroupSharingSameReqdItems) -> b.Vals) (List.order valOrder)
/// It is required to make the TLR closed wrt it's freevars (the env reqdVals0).
/// For gv a generator,
@@ -462,7 +462,7 @@ module Pass2_DetermineReqdItems =
{state with
stack = stack
reqdItemsMap = Zmap.add fclass env state.reqdItemsMap
- fclassM = FlatList.fold (fun mp (k,v) -> Zmap.add k v mp) state.fclassM fclass.Pairs }
+ fclassM = List.fold (fun mp (k,v) -> Zmap.add k v mp) state.fclassM fclass.Pairs }
/// Log requirements for gv in the relevant stack frames
let LogRequiredFrom gv items state =
@@ -486,7 +486,7 @@ module Pass2_DetermineReqdItems =
if verboseTLR then dprintf "shortCall: not-rec: %s\n" gv.LogicalName
state
- let FreeInBindings bs = FlatList.fold (foldOn (freeInBindingRhs CollectTyparsAndLocals) unionFreeVars) emptyFreeVars bs
+ let FreeInBindings bs = List.fold (foldOn (freeInBindingRhs CollectTyparsAndLocals) unionFreeVars) emptyFreeVars bs
/// Intercepts selected exprs.
/// "letrec f1,f2,... = fBody1,fBody2,... in rest" -
@@ -516,7 +516,7 @@ module Pass2_DetermineReqdItems =
LogRequiredFrom f [ReqdVal f] z
let accBinds m z (binds: Bindings) =
- let tlrBs,nonTlrBs = binds |> FlatList.partition (fun b -> Zset.contains b.Var tlrS)
+ let tlrBs,nonTlrBs = binds |> List.partition (fun b -> Zset.contains b.Var tlrS)
// For bindings marked TLR, collect implied env
let fclass = BindingGroupSharingSameReqdItems tlrBs
// what determines env?
@@ -529,10 +529,10 @@ module Pass2_DetermineReqdItems =
let reqdVals0 = reqdVals0 |> Zset.ofList valOrder
// collect into env over bodies
let z = PushFrame fclass (reqdTypars0,reqdVals0,m) z
- let z = (z,tlrBs) ||> FlatList.fold (foldOn (fun b -> b.Expr) exprF)
+ let z = (z,tlrBs) ||> List.fold (foldOn (fun b -> b.Expr) exprF)
let z = SaveFrame fclass z
(* for bindings not marked TRL, collect *)
- let z = (z,nonTlrBs) ||> FlatList.fold (foldOn (fun b -> b.Expr) exprF)
+ let z = (z,nonTlrBs) ||> List.fold (foldOn (fun b -> b.Expr) exprF)
z
match expr with
@@ -559,7 +559,7 @@ module Pass2_DetermineReqdItems =
let z = exprF z body
Some z
| Expr.Let (bind,body,m,_) ->
- let z = accBinds m z (FlatList.one bind)
+ let z = accBinds m z [bind]
let z = exprF z body
Some z
| _ -> None (* NO: no intercept *)
@@ -627,7 +627,7 @@ module Pass2_DetermineReqdItems =
// close the reqdTypars under the subEnv reln
let reqdItemsMap = CloseReqdTypars fclassM reqdItemsMap
// filter out trivial fclass - with no TLR defns
- let reqdItemsMap = Zmap.remove (BindingGroupSharingSameReqdItems FlatList.empty) reqdItemsMap
+ let reqdItemsMap = Zmap.remove (BindingGroupSharingSameReqdItems List.empty) reqdItemsMap
// restrict declist to those with reqdItemsMap bindings (the non-trivial ones)
let declist = List.filter (Zmap.memberOf reqdItemsMap) declist
#if DEBUG
@@ -705,11 +705,10 @@ let FlatEnvPacks g fclassM topValS declist (reqdItemsMap: Zmap FlatList.ofList
+ let vals = List.noRepeats valOrder vals // noRepeats
// Remove genuinely toplevel, no need to close over these
- let vals = vals |> FlatList.filter (IsMandatoryTopLevel >> not)
+ let vals = vals |> List.filter (IsMandatoryTopLevel >> not)
// Remove byrefs, no need to close over these, and would be invalid to do so since their values can change.
//
// Note that it is normally not OK to skip closing over values, since values given (method) TLR must have implementations
@@ -740,26 +739,26 @@ let FlatEnvPacks g fclassM topValS declist (reqdItemsMap: Zmap FlatList.filter (fun v -> not (isByrefLikeTy g v.Type))
+ let vals = vals |> List.filter (fun v -> not (isByrefLikeTy g v.Type))
// Remove values which have been labelled TLR, no need to close over these
- let vals = vals |> FlatList.filter (Zset.memberOf topValS >> not)
+ let vals = vals |> List.filter (Zset.memberOf topValS >> not)
// Carrier sets cannot include constrained polymorphic values. We can't just take such a value out, so for the moment
// we'll just abandon TLR altogether and give a warning about this condition.
- match vals |> FlatList.tryFind (IsGenericValWithGenericContraints g) with
+ match vals |> List.tryFind (IsGenericValWithGenericContraints g) with
| None -> ()
| Some v -> raise (AbortTLR v.Range)
// build cmap for env
- let cmapPairs = vals |> FlatList.map (fun v -> (v,(mkCompGenLocal env.m v.LogicalName v.Type |> fst)))
- let cmap = Zmap.ofFlatList valOrder cmapPairs
+ let cmapPairs = vals |> List.map (fun v -> (v,(mkCompGenLocal env.m v.LogicalName v.Type |> fst)))
+ let cmap = Zmap.ofList valOrder cmapPairs
let aenvFor v = Zmap.force v cmap ("aenvFor",nameOfVal)
let aenvExprFor v = exprForVal env.m (aenvFor v)
// build PackedReqdItems
let reqdTypars = env.reqdTypars
let aenvs = Zmap.values cmap
- let pack = cmapPairs |> FlatList.map (fun (v,aenv) -> mkInvisibleBind aenv (exprForVal env.m v))
+ let pack = cmapPairs |> List.map (fun (v,aenv) -> mkInvisibleBind aenv (exprForVal env.m v))
let unpack =
let unpackCarrier (v,aenv) = mkInvisibleBind (setValHasNoArity v) (exprForVal env.m aenv)
let unpackSubenv f =
@@ -774,18 +773,18 @@ let FlatEnvPacks g fclassM topValS declist (reqdItemsMap: Zmap0 && // only collect Top* bindings when at inner levels (else will drop them!)
- not (FlatList.isEmpty topBinds) // only collect topBinds if there are some!
+ not (List.isEmpty topBinds) // only collect topBinds if there are some!
if liftTheseBindings then
let LiftedDeclaration = isRec,topBinds // LiftedDeclaration Top* decs
let z = {z with rws_preDecs = TreeNode [z.rws_preDecs;LeafNode LiftedDeclaration]} // logged at end
@@ -964,10 +963,9 @@ module Pass4_RewriteAssembly =
let RecursivePreDecs pdsA pdsB =
let pds = fringeTR (TreeNode[pdsA;pdsB])
- let decs = pds |> List.collect (fun (_,x) -> FlatList.toList x) |> FlatList.ofList
+ let decs = pds |> List.collect snd
LeafNode (IsRec,decs)
-
//-------------------------------------------------------------------------
// pass4: lowertop - convert_vterm_bind on TopLevel binds
//-------------------------------------------------------------------------
@@ -989,7 +987,7 @@ module Pass4_RewriteAssembly =
// let f vss = fHat f_freeVars vss
// let fHat f_freeVars vss = f_body[,f_freeVars]
let TransTLRBindings penv (binds:Bindings) =
- if FlatList.isEmpty binds then FlatList.empty,FlatList.empty else
+ if List.isEmpty binds then List.empty,List.empty else
let fc = BindingGroupSharingSameReqdItems binds
let envp = Zmap.force fc penv.envPackM ("TransTLRBindings",string)
@@ -1030,18 +1028,18 @@ module Pass4_RewriteAssembly =
// fHat binding, f rebinding
let fHatBind = mkMultiLambdaBind fHat letSeqPtOpt m fHat_tps fHat_args (fHat_body,rty)
fHatBind
- let rebinds = binds |> FlatList.map fRebinding
- let shortRecBinds = rebinds |> FlatList.filter (fun b -> penv.recShortCallS.Contains(b.Var))
- let newBinds = binds |> FlatList.map (fHatNewBinding shortRecBinds)
+ let rebinds = binds |> List.map fRebinding
+ let shortRecBinds = rebinds |> List.filter (fun b -> penv.recShortCallS.Contains(b.Var))
+ let newBinds = binds |> List.map (fHatNewBinding shortRecBinds)
newBinds,rebinds
let GetAEnvBindings penv fc =
match Zmap.tryFind fc penv.envPackM with
- | None -> FlatList.empty // no env for this mutual binding
+ | None -> List.empty // no env for this mutual binding
| Some envp -> envp.ep_pack // environment pack bindings
let TransBindings xisRec penv (binds:Bindings) =
- let tlrBs,nonTlrBs = binds |> FlatList.partition (fun b -> Zset.contains b.Var penv.tlrS)
+ let tlrBs,nonTlrBs = binds |> List.partition (fun b -> Zset.contains b.Var penv.tlrS)
let fclass = BindingGroupSharingSameReqdItems tlrBs
// Trans each TLR f binding into fHat and f rebind
let newTlrBinds,tlrRebinds = TransTLRBindings penv tlrBs
@@ -1054,14 +1052,14 @@ module Pass4_RewriteAssembly =
if penv.topValS.Contains(bind.Var) then ConvertBind penv.g bind
else bind
- let nonTlrBs = nonTlrBs |> FlatList.map forceTopBindToHaveArity
- let tlrRebinds = tlrRebinds |> FlatList.map forceTopBindToHaveArity
+ let nonTlrBs = nonTlrBs |> List.map forceTopBindToHaveArity
+ let tlrRebinds = tlrRebinds |> List.map forceTopBindToHaveArity
// assemble into replacement bindings
let bindAs,rebinds =
match xisRec with
- | IsRec -> FlatList.toList newTlrBinds @ FlatList.toList tlrRebinds @ FlatList.toList nonTlrBs @ FlatList.toList aenvBinds,[] (* note: aenv last, order matters in letrec! *)
- | NotRec -> FlatList.toList aenvBinds @ FlatList.toList newTlrBinds, FlatList.toList tlrRebinds @ FlatList.toList nonTlrBs (* note: aenv go first, they may be used *)
- FlatList.ofList bindAs, FlatList.ofList rebinds
+ | IsRec -> newTlrBinds @ tlrRebinds @ nonTlrBs @ aenvBinds,[] (* note: aenv last, order matters in letrec! *)
+ | NotRec -> aenvBinds @ newTlrBinds, tlrRebinds @ nonTlrBs (* note: aenv go first, they may be used *)
+ bindAs, rebinds
//-------------------------------------------------------------------------
@@ -1201,7 +1199,7 @@ module Pass4_RewriteAssembly =
let z = EnterInner z
// For letrec, preDecs from RHS must mutually recurse with those from the bindings
let z,pdsPrior = PopPreDecs z
- let binds,z = FlatList.mapFold (TransBindingRhs penv) z binds
+ let binds,z = List.mapFold (TransBindingRhs penv) z binds
let z,pdsRhs = PopPreDecs z
let binds,rebinds = TransBindings IsRec penv binds
let z,binds = LiftTopBinds IsRec penv z binds (* factor Top* repr binds *)
@@ -1220,7 +1218,7 @@ module Pass4_RewriteAssembly =
// For let, preDecs from RHS go before those of bindings, which is collection order
let bind,z = TransBindingRhs penv z bind
- let binds,rebinds = TransBindings NotRec penv (FlatList.one bind)
+ let binds,rebinds = TransBindings NotRec penv [bind]
// factor Top* repr binds
let z,binds = LiftTopBinds NotRec penv z binds
let z,rebinds = LiftTopBinds NotRec penv z rebinds
@@ -1255,7 +1253,7 @@ module Pass4_RewriteAssembly =
and TransDecisionTree penv z x : DecisionTree * RewriteState =
match x with
| TDSuccess (es,n) ->
- let es,z = FlatList.mapFold (TransExpr penv) z es
+ let es,z = List.mapFold (TransExpr penv) z es
TDSuccess(es,n),z
| TDBind (bind,rest) ->
let bind,z = TransBindingRhs penv z bind
@@ -1278,7 +1276,7 @@ module Pass4_RewriteAssembly =
TTarget(vs,e,spTarget),z
and TransValBinding penv z bind = TransBindingRhs penv z bind
- and TransValBindings penv z binds = FlatList.mapFold (TransValBinding penv) z binds
+ and TransValBindings penv z binds = List.mapFold (TransValBinding penv) z binds
and TransModuleExpr penv z x =
match x with
| ModuleOrNamespaceExprWithSig(mty,def,m) ->
diff --git a/src/fsharp/LowerCallsAndSeqs.fs b/src/fsharp/LowerCallsAndSeqs.fs
index 24542ecf091..5ee20ea0f24 100644
--- a/src/fsharp/LowerCallsAndSeqs.fs
+++ b/src/fsharp/LowerCallsAndSeqs.fs
@@ -381,7 +381,7 @@ let LowerSeqExpr g amap overallExpr =
| None ->
None
- | Expr.Match (spBind,exprm,pt,targets,m,ty) when targets |> Array.forall (fun (TTarget(vs,_e,_spTarget)) -> FlatList.isEmpty vs) ->
+ | Expr.Match (spBind,exprm,pt,targets,m,ty) when targets |> Array.forall (fun (TTarget(vs,_e,_spTarget)) -> List.isEmpty vs) ->
// lower all the targets. abandon if any fail to lower
let tgl = targets |> Array.map (fun (TTarget(_vs,e,_spTarget)) -> Lower false isTailCall noDisposeContinuationLabel currentDisposeContinuationLabel e) |> Array.toList
// LIMITATION: non-trivial pattern matches involving or-patterns or active patterns where bindings can't be
diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs
index bb6ad631ea0..c4f33cd564e 100644
--- a/src/fsharp/NameResolution.fs
+++ b/src/fsharp/NameResolution.fs
@@ -724,9 +724,9 @@ and AddModuleOrNamespaceContentsToNameEnv (g:TcGlobals) amap (ad:AccessorDomain)
let nenv = (nenv,tcrefs) ||> AddTyconRefsToNameEnv BulkAdd.Yes false g amap m false
let vrefs =
- mty.AllValsAndMembers.ToFlatList()
- |> FlatList.choose (fun x -> if IsAccessible ad x.Accessibility then TryMkValRefInModRef modref x else None)
- |> FlatList.toArray
+ mty.AllValsAndMembers.ToList()
+ |> List.choose (fun x -> if IsAccessible ad x.Accessibility then TryMkValRefInModRef modref x else None)
+ |> List.toArray
let nenv = AddValRefsToNameEnvWithPriority BulkAdd.Yes pri nenv vrefs
let nenv = (nenv,MakeNestedModuleRefs modref) ||> AddModuleOrNamespaceRefsToNameEnv g amap m root ad
nenv
diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs
index 8813410143e..1844cc6437f 100755
--- a/src/fsharp/NicePrint.fs
+++ b/src/fsharp/NicePrint.fs
@@ -182,7 +182,7 @@ module private PrintIL =
| ILType.Void -> wordL "unit" // These are type-theoretically totally different type-theoretically `void` is Fin 0 and `unit` is Fin (S 0) ... but, this looks like as close as we can get.
| ILType.Array (sh, t) -> layoutILType denv ilTyparSubst t ^^ layoutILArrayShape sh
| ILType.Value t
- | ILType.Boxed t -> layoutILTypeRef denv t.TypeRef ^^ (t.GenericArgs |> ILList.toList |> List.map (layoutILType denv ilTyparSubst) |> paramsL)
+ | ILType.Boxed t -> layoutILTypeRef denv t.TypeRef ^^ (t.GenericArgs |> List.map (layoutILType denv ilTyparSubst) |> paramsL)
| ILType.Ptr t
| ILType.Byref t -> layoutILType denv ilTyparSubst t
| ILType.FunctionPointer t -> layoutILCallingSignature denv ilTyparSubst None t
@@ -195,7 +195,7 @@ module private PrintIL =
// constructors (Their return types are reported as `void`, but this is
// incorrect; so if we're dealing with a constructor we require that the
// return type be passed along as the `cons` parameter.)
- let args = signatur.ArgTypes |> ILList.toList |> List.map (layoutILType denv ilTyparSubst)
+ let args = signatur.ArgTypes |> List.map (layoutILType denv ilTyparSubst)
let res =
match cons with
| Some className -> layoutILTypeRefName denv (SplitNamesForILPath (ungenericizeTypeName className)) ^^ (pruneParms className ilTyparSubst |> paramsL) // special case for constructor return-type (viz., the class itself)
@@ -233,7 +233,7 @@ module private PrintIL =
match cons with
| Some className -> layoutILTypeRefName denv (SplitNamesForILPath (ungenericizeTypeName className)) ^^ (pruneParms className ilTyparSubst |> paramsL) // special case for constructor return-type (viz., the class itself)
| None -> retType |> layoutILType denv ilTyparSubst
- match parameters |> ILList.toList with
+ match parameters with
| [] -> wordL "unit" ^^ wordL "->" ^^ res
| [x] -> layoutILParameter denv ilTyparSubst x ^^ wordL "->" ^^ res
| args -> sepListL (wordL "*") (List.map (layoutILParameter denv ilTyparSubst) args) ^^ wordL "->" ^^ res
@@ -284,13 +284,13 @@ module private PrintIL =
let nameL = wordL name
let layoutGetterType (getterRef:ILMethodRef) =
- if ILList.isEmpty getterRef.ArgTypes then
+ if List.isEmpty getterRef.ArgTypes then
layoutILType denv ilTyparSubst getterRef.ReturnType
else
layoutILCallingSignature denv ilTyparSubst None getterRef.CallingSignature
let layoutSetterType (setterRef:ILMethodRef) =
- let argTypes = setterRef.ArgTypes |> ILList.toList
+ let argTypes = setterRef.ArgTypes
if List.isEmpty argTypes then
emptyL // shouldn't happen
else
diff --git a/src/fsharp/Optimizer.fs b/src/fsharp/Optimizer.fs
index b547523882f..242d3bfde23 100644
--- a/src/fsharp/Optimizer.fs
+++ b/src/fsharp/Optimizer.fs
@@ -940,31 +940,22 @@ let [] localVarSize = 1
let inline AddTotalSizes l = l |> List.sumBy (fun x -> x.TotalSize)
let inline AddFunctionSizes l = l |> List.sumBy (fun x -> x.FunctionSize)
-let inline AddTotalSizesFlat l = l |> FlatList.sumBy (fun x -> x.TotalSize)
-let inline AddFunctionSizesFlat l = l |> FlatList.sumBy (fun x -> x.FunctionSize)
+let inline AddTotalSizesFlat l = l |> List.sumBy (fun x -> x.TotalSize)
+let inline AddFunctionSizesFlat l = l |> List.sumBy (fun x -> x.FunctionSize)
//-------------------------------------------------------------------------
// opt list/array combinators - zipping (_,_) return type
//-------------------------------------------------------------------------
let inline OrEffects l = List.exists (fun x -> x.HasEffect) l
-let inline OrEffectsFlat l = FlatList.exists (fun x -> x.HasEffect) l
+let inline OrEffectsFlat l = List.exists (fun x -> x.HasEffect) l
let inline OrTailcalls l = List.exists (fun x -> x.MightMakeCriticalTailcall) l
-let inline OrTailcallsFlat l = FlatList.exists (fun x -> x.MightMakeCriticalTailcall) l
+let inline OrTailcallsFlat l = List.exists (fun x -> x.MightMakeCriticalTailcall) l
-let rec OptimizeListAux f l acc1 acc2 =
- match l with
- | [] -> List.rev acc1, List.rev acc2
- | (h ::t) ->
- let (x1,x2) = f h
- OptimizeListAux f t (x1::acc1) (x2::acc2)
-
-let OptimizeList f l = OptimizeListAux f l [] []
-
-let OptimizeFlatList f l = l |> FlatList.map f |> FlatList.unzip
+let OptimizeList f l = l |> List.map f |> List.unzip
let NoExprs : (Expr list * list>) = [],[]
-let NoFlatExprs : (FlatExprs * FlatList>) = FlatList.empty, FlatList.empty
+let NoFlatExprs : (FlatExprs * list>) = [], []
//-------------------------------------------------------------------------
// Common ways of building new value infos
@@ -1235,7 +1226,7 @@ let ValueIsUsedOrHasEffect cenv fvs (b:Binding,binfo) =
Zset.contains v (fvs())
let rec SplitValuesByIsUsedOrHasEffect cenv fvs x =
- x |> FlatList.filter (ValueIsUsedOrHasEffect cenv fvs) |> FlatList.unzip
+ x |> List.filter (ValueIsUsedOrHasEffect cenv fvs) |> List.unzip
//-------------------------------------------------------------------------
//
@@ -1278,7 +1269,7 @@ let rec ExprHasEffect g expr =
// REVIEW: could add Expr.Obj on an interface type - these are similar to records of lambda expressions
| _ -> true
and ExprsHaveEffect g exprs = List.exists (ExprHasEffect g) exprs
-and BindingsHaveEffect g binds = FlatList.exists (BindingHasEffect g) binds
+and BindingsHaveEffect g binds = List.exists (BindingHasEffect g) binds
and BindingHasEffect g bind = bind.Expr |> ExprHasEffect g
and OpHasEffect g op =
match op with
@@ -2036,7 +2027,7 @@ and OptimizeFastIntegerForLoop cenv env (spStart,v,e1,dir,e2,e3,m) =
//-------------------------------------------------------------------------
and OptimizeLetRec cenv env (binds,bodyExpr,m) =
- let vs = binds |> FlatList.map (fun v -> v.Var)
+ let vs = binds |> List.map (fun v -> v.Var)
let env = BindInternalValsToUnknown cenv vs env
let binds',env = OptimizeBindings cenv true env binds
let bodyExpr',einfo = OptimizeExpr cenv env bodyExpr
@@ -2044,13 +2035,13 @@ and OptimizeLetRec cenv env (binds,bodyExpr,m) =
// Eliminate any unused bindings, as in let case
let binds'',bindinfos =
let fvs0 = freeInExpr CollectLocals bodyExpr'
- let fvs = FlatList.fold (fun acc x -> unionFreeVars acc (fst x |> freeInBindingRhs CollectLocals)) fvs0 binds'
+ let fvs = List.fold (fun acc x -> unionFreeVars acc (fst x |> freeInBindingRhs CollectLocals)) fvs0 binds'
SplitValuesByIsUsedOrHasEffect cenv (fun () -> fvs.FreeLocals) binds'
// Trim out any optimization info that involves escaping values
- let evalue' = AbstractExprInfoByVars (FlatList.toList vs,[]) einfo.Info
+ let evalue' = AbstractExprInfoByVars (vs,[]) einfo.Info
// REVIEW: size of constructing new closures - should probably add #freevars + #recfixups here
let bodyExpr' = Expr.LetRec(binds'',bodyExpr',m,NewFreeVarsCache())
- let info = CombineValueInfos (einfo :: FlatList.toList bindinfos) evalue'
+ let info = CombineValueInfos (einfo :: bindinfos) evalue'
bodyExpr', info
//-------------------------------------------------------------------------
@@ -2750,7 +2741,7 @@ and OptimizeExprsThenConsiderSplits cenv env exprs =
and OptimizeFlatExprsThenConsiderSplits cenv env exprs =
match exprs with
| [] -> NoFlatExprs
- | _ -> OptimizeFlatList (OptimizeExprThenConsiderSplit cenv env) exprs
+ | _ -> OptimizeList (OptimizeExprThenConsiderSplit cenv env) exprs
and OptimizeExprThenReshapeAndConsiderSplit cenv env (shape,e) =
OptimizeExprThenConsiderSplit cenv env (ReshapeExpr cenv (shape,e))
@@ -2852,7 +2843,7 @@ and OptimizeDecisionTreeTarget cenv env _m (TTarget(vs,e,spTarget)) =
let env = BindInternalValsToUnknown cenv vs env
let e',einfo = OptimizeExpr cenv env e
let e',einfo = ConsiderSplitToMethod cenv.settings.abstractBigTargets cenv.settings.bigTargetSize cenv env (e',einfo)
- let evalue' = AbstractExprInfoByVars (FlatList.toList vs,[]) einfo.Info
+ let evalue' = AbstractExprInfoByVars (vs,[]) einfo.Info
TTarget(vs,e',spTarget),
{ TotalSize=einfo.TotalSize
FunctionSize=einfo.FunctionSize
@@ -2880,7 +2871,7 @@ and OptimizeDecisionTree cenv env m x =
match rest with
| TDSuccess([e],n) ->
let e,_adjust = TryEliminateLet cenv env bind e m
- TDSuccess(FlatList.one e,n),info
+ TDSuccess([e],n),info
| _ ->
TDBind(bind,rest),info
@@ -3034,7 +3025,7 @@ and OptimizeBinding cenv isRec env (TBind(v,e,spBind)) =
errorRecovery exn v.Range
raise (ReportedError (Some exn))
-and OptimizeBindings cenv isRec env xs = FlatList.mapFold (OptimizeBinding cenv isRec) env xs
+and OptimizeBindings cenv isRec env xs = List.mapFold (OptimizeBinding cenv isRec) env xs
and OptimizeModuleExpr cenv env x =
match x with
@@ -3128,7 +3119,7 @@ and OptimizeModuleDef cenv (env,bindInfosColl) x =
(* REVIEW: Eliminate let bindings on the way back up *)
(TMDefRec(isRec,tycons,mbinds,m),
- notlazy { ValInfos = ValInfos(FlatList.map2 (fun bind binfo -> mkValBind bind (mkValInfo binfo bind.Var)) binds binfos)
+ notlazy { ValInfos = ValInfos(List.map2 (fun bind binfo -> mkValBind bind (mkValInfo binfo bind.Var)) binds binfos)
ModuleOrNamespaceInfos = NameMap.ofList minfos}),
(env,bindInfosColl)
| TMAbstract(mexpr) ->
diff --git a/src/fsharp/PatternMatchCompilation.fs b/src/fsharp/PatternMatchCompilation.fs
index 408fe031c2f..884f8ecad49 100644
--- a/src/fsharp/PatternMatchCompilation.fs
+++ b/src/fsharp/PatternMatchCompilation.fs
@@ -734,7 +734,7 @@ let CompilePatternBasic
// targets of filters since if the exception is filtered successfully then we
// will run the handler and hit the sequence point there.
// That sequence point will have the pattern variables bound, which is exactly what we want.
- let tg = TTarget(FlatList.empty,throwExpr,SuppressSequencePointAtTarget )
+ let tg = TTarget(List.empty,throwExpr,SuppressSequencePointAtTarget )
mbuilder.AddTarget tg |> ignore
let clause = TClause(TPat_wild matchm,None,tg,matchm)
incompleteMatchClauseOnce := Some(clause)
@@ -813,7 +813,7 @@ let CompilePatternBasic
let vs2 = GetValsBoundByClause i refuted
let es2 =
- vs2 |> FlatList.map (fun v ->
+ vs2 |> List.map (fun v ->
match valMap.TryFind v with
| None -> error(Error(FSComp.SR.patcMissingVariable(v.DisplayName),v.Range))
| Some res -> res)
@@ -1276,7 +1276,7 @@ let rec CompilePattern g denv amap exprm matchm warnOnUnused actionOnFailure (t
else SequencePointAtTarget
// Make the clause that represents the remaining cases of the pattern match
- let clauseForRestOfMatch = TClause(TPat_wild matchm,None,TTarget(FlatList.empty,expr,spTarget),matchm)
+ let clauseForRestOfMatch = TClause(TPat_wild matchm,None,TTarget(List.empty,expr,spTarget),matchm)
CompilePatternBasic
g denv amap exprm matchm warnOnUnused warnOnIncomplete actionOnFailure (topv,topgtvs)
diff --git a/src/fsharp/QueueList.fs b/src/fsharp/QueueList.fs
index 343589d3739..47ccfea4b53 100644
--- a/src/fsharp/QueueList.fs
+++ b/src/fsharp/QueueList.fs
@@ -10,24 +10,24 @@ open System.Collections.Generic
/// a suffix of elements is stored in reverse order.
///
/// The type doesn't support structural hashing or comparison.
-type internal QueueList<'T>(firstElementsIn: FlatList<'T>, lastElementsRevIn: 'T list, numLastElementsIn: int) =
- let numFirstElements = firstElementsIn.Length
+type internal QueueList<'T>(firstElementsIn:'T list, lastElementsRevIn: 'T list, numLastElementsIn: int) =
+ let numFirstElements = List.length firstElementsIn
// Push the lastElementsRev onto the firstElements every so often.
let push = numLastElementsIn > numFirstElements / 5
// Compute the contents after pushing.
- let firstElements = if push then FlatList.append firstElementsIn (FlatList.ofList (List.rev lastElementsRevIn)) else firstElementsIn
+ let firstElements = if push then List.append firstElementsIn (List.rev lastElementsRevIn) else firstElementsIn
let lastElementsRev = if push then [] else lastElementsRevIn
let numLastElements = if push then 0 else numLastElementsIn
// Compute the last elements on demand.
let lastElements() = if push then [] else List.rev lastElementsRev
- static let empty = QueueList<'T>(FlatList.empty, [], 0)
+ static let empty = QueueList<'T>([], [], 0)
static member Empty : QueueList<'T> = empty
- new (xs:FlatList<'T>) = QueueList(xs,[],0)
+ new (xs:'T list) = QueueList(xs,[],0)
- member x.ToFlatList() = if push then firstElements else FlatList.append firstElements (FlatList.ofList (lastElements()))
+ member x.ToList() = if push then firstElements else List.append firstElements (lastElements())
member internal x.FirstElements = firstElements
member internal x.LastElements = lastElements()
@@ -36,26 +36,26 @@ type internal QueueList<'T>(firstElementsIn: FlatList<'T>, lastElementsRevIn: '
member x.AppendOne(y) = QueueList(firstElements, y :: lastElementsRev, numLastElements+1)
member x.Append(ys:seq<_>) = QueueList(firstElements, (List.rev (Seq.toList ys) @ lastElementsRev), numLastElements+1)
- /// This operation is O(n) anyway, so executing ToFlatList() here is OK
+ /// This operation is O(n) anyway, so executing ToList() here is OK
interface IEnumerable<'T> with
- member x.GetEnumerator() : IEnumerator<'T> = (x.ToFlatList() :> IEnumerable<_>).GetEnumerator()
+ member x.GetEnumerator() : IEnumerator<'T> = (x.ToList() :> IEnumerable<_>).GetEnumerator()
interface IEnumerable with
member x.GetEnumerator() : IEnumerator = ((x :> IEnumerable<'T>).GetEnumerator() :> IEnumerator)
[]
module internal QueueList =
let empty<'T> : QueueList<'T> = QueueList<'T>.Empty
- let ofSeq (x:seq<_>) = QueueList(FlatList.ofSeq x)
+ let ofSeq (x:seq<_>) = QueueList(List.ofSeq x)
let rec iter f (x:QueueList<_>) = Seq.iter f x
let rec map f (x:QueueList<_>) = ofSeq (Seq.map f x)
let rec exists f (x:QueueList<_>) = Seq.exists f x
let rec filter f (x:QueueList<_>) = ofSeq (Seq.filter f x)
- let rec foldBack f (x:QueueList<_>) acc = FlatList.foldBack f x.FirstElements (List.foldBack f x.LastElements acc)
+ let rec foldBack f (x:QueueList<_>) acc = List.foldBack f x.FirstElements (List.foldBack f x.LastElements acc)
let forall f (x:QueueList<_>) = Seq.forall f x
- let ofList (x:list<_>) = QueueList(FlatList.ofList x)
+ let ofList (x:list<_>) = QueueList(x)
let toList (x:QueueList<_>) = Seq.toList x
let tryFind f (x:QueueList<_>) = Seq.tryFind f x
- let one(x) = QueueList (FlatList.one x)
+ let one(x) = QueueList [x]
let appendOne (x:QueueList<_>) y = x.AppendOne(y)
let append (x:QueueList<_>) (ys:QueueList<_>) = x.Append(ys)
diff --git a/src/fsharp/QuotationTranslator.fs b/src/fsharp/QuotationTranslator.fs
index fbae5b3746d..2c4875502d5 100644
--- a/src/fsharp/QuotationTranslator.fs
+++ b/src/fsharp/QuotationTranslator.fs
@@ -118,7 +118,7 @@ let BindSubstVal env v e =
let BindVals env vs = List.fold BindVal env vs // fold left-to-right because indexes are left-to-right
-let BindFlatVals env vs = FlatList.fold BindVal env vs // fold left-to-right because indexes are left-to-right
+let BindFlatVals env vs = List.fold BindVal env vs // fold left-to-right because indexes are left-to-right
exception InvalidQuotedTerm of exn
exception IgnoringPartOfQuotedTermWarning of string * Range.range
@@ -365,11 +365,11 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP.
| Expr.LetRec(binds,body,_,_) ->
let vs = valsOfBinds binds
- let vsR = vs |> FlatList.map (ConvVal cenv env)
+ let vsR = vs |> List.map (ConvVal cenv env)
let env = BindFlatVals env vs
let bodyR = ConvExpr cenv env body
- let bindsR = FlatList.zip vsR (binds |> FlatList.map (fun b -> b.Expr |> ConvExpr cenv env))
- QP.mkLetRec(FlatList.toList bindsR,bodyR)
+ let bindsR = List.zip vsR (binds |> List.map (fun b -> b.Expr |> ConvExpr cenv env))
+ QP.mkLetRec(bindsR,bodyR)
| Expr.Lambda(_,_,_,vs,b,_,_) ->
let v,b = MultiLambdaToTupledLambda cenv.g vs b
@@ -561,7 +561,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP.
| TOp.ILCall(_,_,_,isNewObj,valUseFlags,isProp,_,ilMethRef,enclTypeArgs,methTypeArgs,_tys),[],callArgs ->
let parentTyconR = ConvILTypeRefUnadjusted cenv m ilMethRef.EnclosingTypeRef
let isNewObj = (isNewObj || (match valUseFlags with CtorValUsedAsSuperInit | CtorValUsedAsSelfInit -> true | _ -> false))
- let methArgTypesR = List.map (ConvILType cenv env m) (ILList.toList ilMethRef.ArgTypes)
+ let methArgTypesR = List.map (ConvILType cenv env m) ilMethRef.ArgTypes
let methRetTypeR = ConvILType cenv env m ilMethRef.ReturnType
let methName = ilMethRef.Name
let isPropGet = isProp && methName.StartsWith("get_",System.StringComparison.Ordinal)
@@ -883,8 +883,8 @@ and ConvDecisionTree cenv env tgs typR x =
let (TTarget(vars,rhs,_)) = tgs.[n]
// TAST stores pattern bindings in reverse order for some reason
// Reverse them here to give a good presentation to the user
- let args = List.rev (FlatList.toList args)
- let vars = List.rev (FlatList.toList vars)
+ let args = List.rev args
+ let vars = List.rev vars
let varsR = vars |> List.map (ConvVal cenv env)
let targetR = ConvExpr cenv (BindVals env vars) rhs
@@ -945,7 +945,7 @@ and ConvVoidType cenv m = QP.mkILNamedTy(ConvTyconRef cenv cenv.g.system_Void_tc
and ConvILType cenv env m ty =
match ty with
- | ILType.Boxed tspec | ILType.Value tspec -> QP.mkILNamedTy(ConvILTypeRefUnadjusted cenv m tspec.TypeRef, List.map (ConvILType cenv env m) (ILList.toList tspec.GenericArgs))
+ | ILType.Boxed tspec | ILType.Value tspec -> QP.mkILNamedTy(ConvILTypeRefUnadjusted cenv m tspec.TypeRef, List.map (ConvILType cenv env m) tspec.GenericArgs)
| ILType.Array (shape,ty) -> QP.mkArrayTy(shape.Rank,ConvILType cenv env m ty)
| ILType.TypeVar idx -> QP.mkVarTy(int idx)
| ILType.Void -> ConvVoidType cenv m
diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs
index 8e5ddb25045..0523f023d90 100644
--- a/src/fsharp/TastOps.fs
+++ b/src/fsharp/TastOps.fs
@@ -1035,7 +1035,7 @@ type MatchBuilder(spBind,inpRange: Range.range) =
targets.Add(tg);
n
- member x.AddResultTarget(e,spTarget) = TDSuccess(FlatList.empty, x.AddTarget(TTarget(FlatList.empty,e,spTarget)))
+ member x.AddResultTarget(e,spTarget) = TDSuccess([], x.AddTarget(TTarget([],e,spTarget)))
member x.CloseTargets() = targets |> ResizeArray.toList
@@ -1107,12 +1107,12 @@ let mkCompGenBind v e = TBind(v,e,NoSequencePointAtStickyBinding)
/// Make bindings that are compiler generated (though the variables may not be - e.g. they may be lambda arguments in a beta reduction)
let mkCompGenBinds vs es =
if List.length vs <> List.length es then failwith "mkCompGenBinds: invalid argument";
- List.map2 mkCompGenBind vs es |> FlatList.ofList
+ List.map2 mkCompGenBind vs es
// n.b. type gives type of body
let mkLetBind m bind body = Expr.Let(bind,body, m, NewFreeVarsCache())
let mkLetsBind m binds body = List.foldBack (mkLetBind m) binds body
-let mkLetsFromBindings m binds body = FlatList.foldBack (mkLetBind m) binds body
+let mkLetsFromBindings m binds body = List.foldBack (mkLetBind m) binds body
let mkLet seqPtOpt m v x body = mkLetBind m (mkBind seqPtOpt v x) body
let mkCompGenLet m v x body = mkLetBind m (mkCompGenBind v x) body
@@ -1123,13 +1123,13 @@ let mkInvisibleBinds (vs: Val list) (es: Expr list) =
List.map2 mkInvisibleBind vs es
let mkInvisibleFlatBindings vs es =
- if FlatList.length vs <> FlatList.length es then failwith "mkInvisibleFlatBindings: invalid argument";
- FlatList.map2 mkInvisibleBind vs es
+ if List.length vs <> List.length es then failwith "mkInvisibleFlatBindings: invalid argument";
+ List.map2 mkInvisibleBind vs es
let mkInvisibleLets m vs xs body = mkLetsBind m (mkInvisibleBinds vs xs) body
let mkInvisibleLetsFromBindings m vs xs body = mkLetsFromBindings m (mkInvisibleFlatBindings vs xs) body
-let mkLetRecBinds m binds body = if FlatList.isEmpty binds then body else Expr.LetRec(binds,body, m, NewFreeVarsCache())
+let mkLetRecBinds m binds body = if List.isEmpty binds then body else Expr.LetRec(binds,body, m, NewFreeVarsCache())
//-------------------------------------------------------------------------
// Type schemes...
@@ -2021,7 +2021,7 @@ let freeInTypesLeftToRight g thruFlag ty = accFreeInTypesLeftToRight g true thru
let freeInTypesLeftToRightSkippingConstraints g ty = accFreeInTypesLeftToRight g false true emptyFreeTyparsLeftToRight ty |> List.rev
let valOfBind (b:Binding) = b.Var
-let valsOfBinds (binds:Bindings) = binds |> FlatList.map (fun b -> b.Var)
+let valsOfBinds (binds:Bindings) = binds |> List.map (fun b -> b.Var)
//--------------------------------------------------------------------------
// Values representing member functions on F# types
@@ -3259,8 +3259,7 @@ module DebugPrint = begin
and letRecL binds bodyL =
let eqnsL =
- binds
- |> FlatList.toList
+ binds
|> List.mapHeadTail (fun bind -> wordL "rec" ^^ bindingL bind ^^ wordL "in")
(fun bind -> wordL "and" ^^ bindingL bind ^^ wordL "in")
(aboveListL eqnsL @@ bodyL)
@@ -3447,7 +3446,7 @@ module DebugPrint = begin
and decisionTreeL x =
match x with
| TDBind (bind,body) -> let bind = wordL "let" ^^ bindingL bind ^^ wordL "in" in (bind @@ decisionTreeL body)
- | TDSuccess (args,n) -> wordL "Success" ^^ leftL "T" ^^ intL n ^^ tupleL (args |> FlatList.toList |> List.map exprL)
+ | TDSuccess (args,n) -> wordL "Success" ^^ leftL "T" ^^ intL n ^^ tupleL (args |> List.map exprL)
| TDSwitch (test,dcases,dflt,_) -> (wordL "Switch" --- exprL test) @@--
(aboveListL (List.map dcaseL dcases) @@
match dflt with
@@ -3466,7 +3465,7 @@ module DebugPrint = begin
| (Test.ActivePatternCase (exp,_,_,_,_)) -> wordL "query" ^^ exprL exp
and targetL i (TTarget (argvs,body,_)) = leftL "T" ^^ intL i ^^ tupleL (flatValsL argvs) ^^ rightL ":" --- exprL body
- and flatValsL vs = vs |> FlatList.toList |> List.map valL
+ and flatValsL vs = vs |> List.map valL
and tmethodL (TObjExprMethod(TSlotSig(nm,_,_,_,_,_), _, tps, vs, e, _)) =
(wordL "TObjExprMethod" --- (wordL nm) ^^ wordL "=") --
@@ -4097,7 +4096,7 @@ and accFreeInExprNonLinear opts x acc =
| Expr.TyChoose (vs,b,_) ->
unionFreeVars (accFreeTyvars opts boundTypars vs (freeInExpr opts b)) acc
| Expr.LetRec (binds,e,_,cache) ->
- unionFreeVars (freeVarsCacheCompute opts cache (fun () -> FlatList.foldBack (bindLhs opts) binds (FlatList.foldBack (accBindRhs opts) binds (freeInExpr opts e)))) acc
+ unionFreeVars (freeVarsCacheCompute opts cache (fun () -> List.foldBack (bindLhs opts) binds (List.foldBack (accBindRhs opts) binds (freeInExpr opts e)))) acc
| Expr.Let _ ->
failwith "unreachable - linear expr"
| Expr.Obj (_,typ,basev,basecall,overrides,iimpls,_) ->
@@ -4219,9 +4218,9 @@ and accFreeInTargets opts targets acc =
Array.foldBack (accFreeInTarget opts) targets acc
and accFreeInTarget opts (TTarget(vs,e,_)) acc =
- FlatList.foldBack (boundLocalVal opts) vs (accFreeInExpr opts e acc)
+ List.foldBack (boundLocalVal opts) vs (accFreeInExpr opts e acc)
-and accFreeInFlatExprs opts (es:FlatExprs) acc = FlatList.foldBack (accFreeInExpr opts) es acc
+and accFreeInFlatExprs opts (es:FlatExprs) acc = List.foldBack (accFreeInExpr opts) es acc
and accFreeInExprs opts (es: Exprs) acc =
match es with
@@ -4701,7 +4700,7 @@ and remapValFlags tmenv x =
| _ -> x
and remapExprs g compgen tmenv es = List.mapq (remapExpr g compgen tmenv) es
-and remapFlatExprs g compgen tmenv es = FlatList.mapq (remapExpr g compgen tmenv) es
+and remapFlatExprs g compgen tmenv es = List.mapq (remapExpr g compgen tmenv) es
and remapDecisionTree g compgen tmenv x =
match x with
@@ -4734,7 +4733,7 @@ and copyAndRemapAndBindBindings g compgen tmenv binds =
let vs', tmenvinner = copyAndRemapAndBindVals g compgen tmenv (valsOfBinds binds)
remapAndRenameBinds g compgen tmenvinner binds vs',tmenvinner
-and remapAndRenameBinds g compgen tmenvinner binds vs' = FlatList.map2 (remapAndRenameBind g compgen tmenvinner) binds vs'
+and remapAndRenameBinds g compgen tmenvinner binds vs' = List.map2 (remapAndRenameBind g compgen tmenvinner) binds vs'
and remapAndRenameBind g compgen tmenvinner (TBind(_,repr,letSeqPtOpt)) v' = TBind(v', remapExpr g compgen tmenvinner repr,letSeqPtOpt)
and remapMethod g compgen tmenv (TObjExprMethod(slotsig,attribs,tps,vs,e,m)) =
@@ -5047,7 +5046,7 @@ and remarkInterfaceImpl m (ty,overrides) =
and remarkExprs m es = es |> List.map (remarkExpr m)
-and remarkFlatExprs m es = es |> FlatList.map (remarkExpr m)
+and remarkFlatExprs m es = es |> List.map (remarkExpr m)
and remarkDecisionTree m x =
match x with
@@ -5055,7 +5054,7 @@ and remarkDecisionTree m x =
| TDSuccess (es,n) -> TDSuccess (remarkFlatExprs m es,n)
| TDBind (bind,rest) -> TDBind(remarkBind m bind,remarkDecisionTree m rest)
-and remarkBinds m binds = FlatList.map (remarkBind m) binds
+and remarkBinds m binds = List.map (remarkBind m) binds
// This very deliberately drops the sequence points since this is used when adjusting the marks for inlined expressions
and remarkBind m (TBind(v,repr,_)) =
@@ -5343,7 +5342,7 @@ let foldLinearBindingTargetsOfMatch tree (targets: _[]) =
// Check if this is a bind-then-success tree
match targetOfSuccessDecisionTree tree with
- | Some i when isLinearTgtIdx i -> TDSuccess(FlatList.empty,i)
+ | Some i when isLinearTgtIdx i -> TDSuccess([],i)
| _ ->
match tree with
| TDSwitch (e,edges,dflt,m) -> TDSwitch (e,List.map rebuildDecisionTreeEdge edges,Option.map rebuildDecisionTree dflt,m)
@@ -5363,8 +5362,8 @@ let foldLinearBindingTargetsOfMatch tree (targets: _[]) =
// The value bindings are moved to become part of the target.
// Hence the expressions in the value bindings can be remarked with the range of the target.
let mTarget = exprTarget.Range
- let es = es |> FlatList.map (remarkExpr mTarget)
- TTarget(FlatList.empty,mkLetsBind mTarget binds (mkInvisibleLetsFromBindings mTarget vs es exprTarget),spTarget)
+ let es = es |> List.map (remarkExpr mTarget)
+ TTarget(List.empty,mkLetsBind mTarget binds (mkInvisibleLetsFromBindings mTarget vs es exprTarget),spTarget)
else tg )
tree',targets'
@@ -5684,7 +5683,7 @@ let mkFolders (folders : _ ExprFolder) =
targetIntercept = targetIntercept;
tmethodIntercept = tmethodIntercept} = folders
let rec exprsF z xs = List.fold exprF z xs
- and flatExprsF z xs = FlatList.fold exprF z xs
+ and flatExprsF z xs = List.fold exprF z xs
and exprF z x =
match exprIntercept exprF z x with // fold this node, then recurse
| Some z -> z // intercepted
@@ -5737,7 +5736,7 @@ let mkFolders (folders : _ ExprFolder) =
and valBindsF dtree z binds =
let z = recBindingsIntercept z binds
- FlatList.fold (bindF dtree) z binds
+ List.fold (bindF dtree) z binds
and bindF dtree z (bind:Binding) =
let z = valBindingSiteIntercept z (dtree,bind.Var)
@@ -6814,14 +6813,14 @@ let LinearizeTopMatchAux g parent (spBind,m,tree,targets,m2,ty) =
(* Have failing targets and ONE successful one, so linearize *)
let (TTarget (vs,rhs,spTarget)) = Option.get (List.tryFind (isThrowingTarget >> not) targetsL)
(* note - old code here used copy value to generate locals - this was not right *)
- let fvs = vs |> FlatList.map (fun v -> fst(mkLocal v.Range v.LogicalName v.Type)) (* fresh *)
- let vtys = vs |> FlatList.map (fun v -> v.Type)
- let tmpTy = mkRefTupledVarsTy g (FlatList.toList vs)
+ let fvs = vs |> List.map (fun v -> fst(mkLocal v.Range v.LogicalName v.Type)) (* fresh *)
+ let vtys = vs |> List.map (fun v -> v.Type)
+ let tmpTy = mkRefTupledVarsTy g vs
let tmp,tmpe = mkCompGenLocal m "matchResultHolder" tmpTy
AdjustValToTopVal tmp parent ValReprInfo.emptyValData;
- let newTg = TTarget (fvs,mkRefTupledVars g m (FlatList.toList fvs),spTarget)
+ let newTg = TTarget (fvs,mkRefTupledVars g m fvs,spTarget)
let fixup (TTarget (tvs,tx,spTarget)) =
match destThrow tx with
| Some (m,_,e) -> let tx = mkThrow m tmpTy e
@@ -6830,9 +6829,9 @@ let LinearizeTopMatchAux g parent (spBind,m,tree,targets,m2,ty) =
let targets = Array.map fixup targets
let binds =
- vs |> FlatList.mapi (fun i v ->
+ vs |> List.mapi (fun i v ->
let ty = v.Type
- let rhs = etaExpandTypeLambda g m v.Typars (itemsProj (FlatList.toList vtys) i tmpe, ty)
+ let rhs = etaExpandTypeLambda g m v.Typars (itemsProj vtys i tmpe, ty)
(* update the arity of the value *)
v.SetValReprInfo (Some (InferArityOfExpr g ty [] [] rhs))
mkInvisibleBind v rhs) in (* vi = proj tmp *)
@@ -7135,7 +7134,7 @@ let mkIsInstConditional g m tgty vinpe v e2 e3 =
else
let mbuilder = new MatchBuilder(NoSequencePointAtInvisibleBinding,m)
- let tg2 = TDSuccess(FlatList.one (mkCallUnbox g m tgty vinpe), mbuilder.AddTarget(TTarget(FlatList.one v,e2,SuppressSequencePointAtTarget)))
+ let tg2 = TDSuccess([mkCallUnbox g m tgty vinpe], mbuilder.AddTarget(TTarget([v],e2,SuppressSequencePointAtTarget)))
let tg3 = mbuilder.AddResultTarget(e3,SuppressSequencePointAtTarget)
let dtree = TDSwitch(vinpe,[TCase(Test.IsInst(tyOfExpr g vinpe,tgty),tg2)],Some tg3,m)
let expr = mbuilder.Close(dtree,m,tyOfExpr g e2)
@@ -7340,7 +7339,7 @@ let rec rewriteBind env bind =
and rewriteBindStructure env (TBind(v,e,letSeqPtOpt)) =
TBind(v,RewriteExpr env e,letSeqPtOpt)
-and rewriteBinds env binds = FlatList.map (rewriteBind env) binds
+and rewriteBinds env binds = List.map (rewriteBind env) binds
and RewriteExpr env expr =
match expr with
@@ -7447,13 +7446,13 @@ and rewriteLinearExpr env expr contf =
contf (RewriteExpr env expr)
and rewriteExprs env exprs = List.mapq (RewriteExpr env) exprs
-and rewriteFlatExprs env exprs = FlatList.mapq (RewriteExpr env) exprs
+and rewriteFlatExprs env exprs = List.mapq (RewriteExpr env) exprs
and rewriteDecisionTree env x =
match x with
| TDSuccess (es,n) ->
let es' = rewriteFlatExprs env es
- if FlatList.physicalEquality es es' then x
+ if LanguagePrimitives.PhysicalEquality es es' then x
else TDSuccess(es',n)
| TDSwitch (e,cases,dflt,m) ->
@@ -7665,13 +7664,13 @@ let IsSimpleSyntacticConstantExpr g inputExpr =
and checkDecisionTree vrefs x =
match x with
- | TDSuccess (es,_n) -> es |> FlatList.forall (checkExpr vrefs)
+ | TDSuccess (es,_n) -> es |> List.forall (checkExpr vrefs)
| TDSwitch (e,cases,dflt,_m) -> checkExpr vrefs e && cases |> List.forall (checkDecisionTreeCase vrefs) && dflt |> Option.forall (checkDecisionTree vrefs)
| TDBind (bind,body) -> checkExpr vrefs bind.Expr && checkDecisionTree (vrefs.Add bind.Var.Stamp) body
and checkDecisionTreeCase vrefs (TCase(discrim,dtree)) =
(match discrim with Test.Const _c -> true | _ -> false) && checkDecisionTree vrefs dtree
and checkDecisionTreeTarget vrefs (TTarget(vs,e,_)) =
- let vrefs = ((vrefs, vs) ||> FlatList.fold (fun s v -> s.Add v.Stamp))
+ let vrefs = ((vrefs, vs) ||> List.fold (fun s v -> s.Add v.Stamp))
checkExpr vrefs e
checkExpr Set.empty inputExpr
diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs
index 268c9b5b67e..0392ea8c292 100755
--- a/src/fsharp/TastPickle.fs
+++ b/src/fsharp/TastPickle.fs
@@ -425,19 +425,7 @@ let p_array f (x: 'T[]) st =
let p_list f x st = p_array f (Array.ofList x) st
-
-#if FLAT_LIST_AS_LIST
-#else
-let p_FlatList f (x: FlatList<'T>) st = p_list f x st
-#endif
-#if FLAT_LIST_AS_ARRAY_STRUCT
-//#else
-let p_FlatList f (x: FlatList<'T>) st = p_array f (match x.array with null -> [| |] | _ -> x.array) st
-#endif
-#if FLAT_LIST_AS_ARRAY
-//#else
-let p_FlatList f (x: FlatList<'T>) st = p_array f x st
-#endif
+let p_List f (x: 'T list) st = p_list f x st
let p_wrap (f: 'T -> 'U) (p : 'U pickler) : 'T pickler = (fun x st -> p (f x) st)
let p_option f x st =
@@ -503,15 +491,15 @@ let u_list f st = Array.toList (u_array f st)
#if FLAT_LIST_AS_LIST
#else
-let u_FlatList f st = u_list f st // new FlatList<_> (u_array f st)
+let u_List f st = u_list f st // new List<_> (u_array f st)
#endif
#if FLAT_LIST_AS_ARRAY_STRUCT
//#else
-let u_FlatList f st = FlatList(u_array f st)
+let u_List f st = List(u_array f st)
#endif
#if FLAT_LIST_AS_ARRAY
//#else
-let u_FlatList f st = u_array f st
+let u_List f st = u_array f st
#endif
let u_array_revi f st =
@@ -872,7 +860,7 @@ let rec p_ILType ty st =
| ILType.TypeVar n -> p_byte 7 st; p_uint16 n st
| ILType.Modified (req,tref,ty) -> p_byte 8 st; p_tup3 p_bool p_ILTypeRef p_ILType (req,tref,ty) st
-and p_ILTypes tys = p_list p_ILType (ILList.toList tys)
+and p_ILTypes tys = p_list p_ILType tys
and p_ILBasicCallConv x st =
p_byte (match x with
@@ -927,7 +915,7 @@ let rec u_ILType st =
| 7 -> u_uint16 st |> mkILTyvarTy
| 8 -> u_tup3 u_bool u_ILTypeRef u_ILType st |> ILType.Modified
| _ -> ufailwith st "u_ILType"
-and u_ILTypes st = ILList.ofList (u_list u_ILType st)
+and u_ILTypes st = u_list u_ILType st
and u_ILCallSig = u_wrap (fun (a,b,c) -> {CallingConv=a; ArgTypes=b; ReturnType=c}) (u_tup3 u_ILCallConv u_ILTypes u_ILType)
and u_ILTypeSpec st = let a,b = u_tup2 u_ILTypeRef u_ILTypes st in ILTypeSpec.Create(a,b)
@@ -1688,7 +1676,7 @@ and p_tycon_repr x st =
p_byte 0 st; false
else
// Pickle generated type definitions as a TAsmRepr
- p_byte 1 st; p_byte 2 st; p_ILType (mkILBoxedType(ILTypeSpec.Create(ExtensionTyping.GetILTypeRefOfProvidedType(info.ProvidedType ,range0),emptyILGenericArgs))) st; true
+ p_byte 1 st; p_byte 2 st; p_ILType (mkILBoxedType(ILTypeSpec.Create(ExtensionTyping.GetILTypeRefOfProvidedType(info.ProvidedType ,range0),[]))) st; true
| TProvidedNamespaceExtensionPoint _ -> p_byte 0 st; false
#endif
| TILObjectRepr (_,_,td) -> error (Failure("Unexpected IL type definition"+td.Name))
@@ -2535,26 +2523,26 @@ and u_intf st = u_tup2 u_typ u_methods st
and u_intfs st = u_list u_intf st
#if INCLUDE_METADATA_WRITER
-let _ = fill_p_binds (p_FlatList p_bind)
+let _ = fill_p_binds (p_List p_bind)
let _ = fill_p_targets (p_array p_target)
let _ = fill_p_constraints (p_list p_static_optimization_constraint)
let _ = fill_p_Exprs (p_list p_expr)
let _ = fill_p_expr_fwd p_expr
-let _ = fill_p_FlatExprs (p_FlatList p_expr)
+let _ = fill_p_FlatExprs (p_List p_expr)
let _ = fill_p_attribs (p_list p_attrib)
let _ = fill_p_Vals (p_list p_Val)
-let _ = fill_p_FlatVals (p_FlatList p_Val)
+let _ = fill_p_FlatVals (p_List p_Val)
#endif
-let _ = fill_u_binds (u_FlatList u_bind)
+let _ = fill_u_binds (u_List u_bind)
let _ = fill_u_targets (u_array u_target)
let _ = fill_u_constraints (u_list u_static_optimization_constraint)
let _ = fill_u_Exprs (u_list u_expr)
let _ = fill_u_expr_fwd u_expr
-let _ = fill_u_FlatExprs (u_FlatList u_expr)
+let _ = fill_u_FlatExprs (u_List u_expr)
let _ = fill_u_attribs (u_list u_attrib)
let _ = fill_u_Vals (u_list u_Val)
-let _ = fill_u_FlatVals (u_FlatList u_Val)
+let _ = fill_u_FlatVals (u_List u_Val)
//---------------------------------------------------------------------------
// Pickle/unpickle F# interface data
diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs
index 45b9b098e92..34e8ac305d9 100755
--- a/src/fsharp/TypeChecker.fs
+++ b/src/fsharp/TypeChecker.fs
@@ -2065,7 +2065,7 @@ module GeneralizationHelpers =
&& List.forall (IsGeneralizableValue g) args
| Expr.LetRec(binds,body,_,_) ->
- binds |> FlatList.forall (fun b -> IsGeneralizableValue g b.Expr) &&
+ binds |> List.forall (fun b -> IsGeneralizableValue g b.Expr) &&
IsGeneralizableValue g body
| Expr.Let(bind,body,_,_) ->
IsGeneralizableValue g bind.Expr &&
@@ -3116,7 +3116,7 @@ let CompilePatternForMatchClauses cenv env mExpr matchm warnOnUnused actionOnFai
// CLEANUP: avoid code duplication with code further below, i.e.all callers should call CompilePatternForMatch
match tclauses with
| [TClause(TPat_as (pat1,PBind (v,TypeScheme(generalizedTypars,_)),_),None,TTarget(vs,e,spTarget),m2)] ->
- let expr = CompilePatternForMatch cenv env mExpr matchm warnOnUnused actionOnFailure (v,generalizedTypars) [TClause(pat1,None,TTarget(FlatListSet.remove valEq v vs,e,spTarget),m2)] inputTy resultTy
+ let expr = CompilePatternForMatch cenv env mExpr matchm warnOnUnused actionOnFailure (v,generalizedTypars) [TClause(pat1,None,TTarget(ListSet.remove valEq v vs,e,spTarget),m2)] inputTy resultTy
v,expr
| _ ->
let idv,_ = Tastops.mkCompGenLocal mExpr "matchValue" inputTy
@@ -3646,7 +3646,7 @@ let EliminateInitializationGraphs
// Composite expressions
| Expr.Const _ -> ()
| Expr.LetRec (binds,e,_,_) ->
- binds |> FlatList.iter (CheckBinding (strict st))
+ binds |> List.iter (CheckBinding (strict st))
CheckExpr (strict st) e
| Expr.Let (bind,e,_,_) ->
CheckBinding (strict st) bind
@@ -3671,7 +3671,7 @@ let EliminateInitializationGraphs
and CheckBinding st (TBind(_,e,_)) = CheckExpr st e
and CheckDecisionTree st = function
| TDSwitch(e1,csl,dflt,_) -> CheckExpr st e1; List.iter (fun (TCase(_,d)) -> CheckDecisionTree st d) csl; Option.iter (CheckDecisionTree st) dflt
- | TDSuccess (es,_) -> es |> FlatList.iter (CheckExpr st)
+ | TDSuccess (es,_) -> es |> List.iter (CheckExpr st)
| TDBind(bind,e) -> CheckBinding st bind; CheckDecisionTree st e
and CheckDecisionTreeTarget st (TTarget(_,e,_)) = CheckExpr st e
@@ -6801,7 +6801,7 @@ and TcForEachExpr cenv overallTy env tpenv (pat,enumSynExpr,bodySynExpr,mWholeEx
// Add the pattern match compilation
let bodyExpr =
- let valsDefinedByMatching = FlatListSet.remove valEq elemVar vspecs
+ let valsDefinedByMatching = ListSet.remove valEq elemVar vspecs
CompilePatternForMatch
cenv env enumSynExpr.Range pat.Range false IgnoreWithWarning (elemVar,[])
[TClause(pat,None,TTarget(valsDefinedByMatching,bodyExpr,SequencePointAtTarget),mForLoopStart)]
@@ -7255,25 +7255,25 @@ and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv
let mkSynLambda p e m = SynExpr.Lambda(false,false,p,e,m)
- let mkExprForVarSpace m (patvs:FlatList) =
- match FlatList.toList patvs with
+ let mkExprForVarSpace m (patvs: Val list) =
+ match patvs with
| [] -> SynExpr.Const(SynConst.Unit,m)
| [v] -> SynExpr.Ident v.Id
| vs -> SynExpr.Tuple((vs |> List.map (fun v -> SynExpr.Ident v.Id)), [], m)
- let mkSimplePatForVarSpace m (patvs:FlatList) =
+ let mkSimplePatForVarSpace m (patvs: Val list) =
let spats =
- match FlatList.toList patvs with
+ match patvs with
| [] -> []
| [v] -> [mkSynSimplePatVar false v.Id]
| vs -> vs |> List.map (fun v -> mkSynSimplePatVar false v.Id)
SynSimplePats.SimplePats (spats, m)
- let mkPatForVarSpace m (patvs:FlatList) =
- match FlatList.toList patvs with
+ let mkPatForVarSpace m (patvs: Val list) =
+ match patvs with
| [] -> SynPat.Const (SynConst.Unit, m)
| [v] -> mkSynPatVar None v.Id
- | vs -> SynPat.Tuple((vs |> FlatList.toList |> List.map (fun x -> mkSynPatVar None x.Id)), m)
+ | vs -> SynPat.Tuple((vs |> List.map (fun x -> mkSynPatVar None x.Id)), m)
let (|OptionalSequential|) e =
match e with
@@ -7299,12 +7299,12 @@ and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv
| _ ->
false
- let addVarsToVarSpace (varSpace: LazyWithContext * TcEnv, range>) f =
+ let addVarsToVarSpace (varSpace: LazyWithContext) f =
LazyWithContext.Create
((fun m ->
- let (patvs: FlatList, env) = varSpace.Force m
+ let (patvs: Val list, env) = varSpace.Force m
let vs, envinner = f m env
- let patvs = FlatList.append patvs (vs |> FlatList.filter (fun v -> not (patvs |> FlatList.exists (fun v2 -> v.LogicalName = v2.LogicalName))))
+ let patvs = List.append patvs (vs |> List.filter (fun v -> not (patvs |> List.exists (fun v2 -> v.LogicalName = v2.LogicalName))))
patvs, envinner),
id)
@@ -9787,7 +9787,7 @@ and TcNewDelegateThen cenv overallTy env tpenv mDelTy mExprAndArg delegateTy arg
and bindLetRec (binds:Bindings) m e =
- if FlatList.isEmpty binds then
+ if List.isEmpty binds then
e
else
Expr.LetRec (binds,e,m,NewFreeVarsCache())
@@ -9826,7 +9826,7 @@ and TcLinearExprs bodyChecker cenv env overallTy tpenv isCompExpr expr cont =
if isUse then errorR(Error(FSComp.SR.tcBindingCannotBeUseAndRec(),m))
let binds,envinner,tpenv = TcLetrec ErrorOnOverrides cenv env tpenv (binds,m,m)
let bodyExpr,tpenv = bodyChecker overallTy envinner tpenv body
- let bodyExpr = bindLetRec (FlatList.ofList binds) m bodyExpr
+ let bodyExpr = bindLetRec binds m bodyExpr
cont (bodyExpr,tpenv)
else
// TcLinearExprs processes multiple 'let' bindings in a tail recursive way
@@ -9847,7 +9847,7 @@ and TcMatchPattern cenv inputTy env tpenv (pat:SynPat,optWhenExpr) =
let patf',(tpenv,names,_) = TcPat WarnOnUpperCase cenv env None (ValInline.Optional,permitInferTypars,noArgOrRetAttribs,false,None,false) (tpenv,Map.empty,Set.empty) inputTy pat
let envinner,values,vspecMap = MakeAndPublishSimpleVals cenv env m names false
let optWhenExpr',tpenv = Option.mapFold (TcExpr cenv cenv.g.bool_ty envinner) tpenv optWhenExpr
- patf' (TcPatPhase2Input (values, true)),optWhenExpr',FlatList.ofList (NameMap.range vspecMap),envinner,tpenv
+ patf' (TcPatPhase2Input (values, true)),optWhenExpr', NameMap.range vspecMap,envinner,tpenv
and TcMatchClauses cenv inputTy resultTy env tpenv clauses =
List.mapFold (TcMatchClause cenv inputTy resultTy env) tpenv clauses
@@ -10458,16 +10458,16 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (binds,bindsm,scope
let letExpr = mkLet spBind m tmp rhsExpr bodyExpr
letExpr,bodyExprTy
- let allValsDefinedByPattern = (NameMap.range prelimRecValues |> FlatList.ofList)
+ let allValsDefinedByPattern = NameMap.range prelimRecValues
let mkPatBind (bodyExpr,bodyExprTy) =
- let valsDefinedByMatching = FlatListSet.remove valEq tmp allValsDefinedByPattern
+ let valsDefinedByMatching = ListSet.remove valEq tmp allValsDefinedByPattern
let matchx = CompilePatternForMatch cenv env m m true ThrowIncompleteMatchException (tmp,generalizedTypars) [TClause(pat'',None,TTarget(valsDefinedByMatching,bodyExpr,SuppressSequencePointAtTarget),m)] tauTy bodyExprTy
let matchx = if (DeclKind.ConvertToLinearBindings declKind) then LinearizeTopMatch cenv.g altActualParent matchx else matchx
matchx,bodyExprTy
let mkCleanup (bodyExpr,bodyExprTy) =
if isUse && not isFixed then
- (allValsDefinedByPattern,(bodyExpr,bodyExprTy)) ||> FlatList.foldBack (fun v (bodyExpr,bodyExprTy) ->
+ (allValsDefinedByPattern,(bodyExpr,bodyExprTy)) ||> List.foldBack (fun v (bodyExpr,bodyExprTy) ->
AddCxTypeMustSubsumeType ContextInfo.NoContext denv cenv.css v.Range NoTrace cenv.g.system_IDisposable_typ v.Type
let cleanupE = BuildDisposableCleanup cenv env m v
mkTryFinally cenv.g (bodyExpr,cleanupE,m,bodyExprTy,SequencePointInBodyOfTry,NoSequencePointAtFinally),bodyExprTy)
diff --git a/src/fsharp/import.fs b/src/fsharp/import.fs
index 423d769bacd..c0bca3ec1e0 100644
--- a/src/fsharp/import.fs
+++ b/src/fsharp/import.fs
@@ -158,7 +158,7 @@ let rec ImportILType (env:ImportMap) m tinst typ =
| ILType.Boxed tspec | ILType.Value tspec ->
let tcref = ImportILTypeRef env m tspec.TypeRef
- let inst = tspec.GenericArgs |> ILList.toList |> List.map (ImportILType env m tinst)
+ let inst = tspec.GenericArgs |> List.map (ImportILType env m tinst)
ImportTyconRefApp env tcref inst
| ILType.Byref ty -> mkByrefTy env.g (ImportILType env m tinst ty)
@@ -178,7 +178,7 @@ let rec CanImportILType (env:ImportMap) m typ =
| ILType.Array(_bounds,ty) -> CanImportILType env m ty
| ILType.Boxed tspec | ILType.Value tspec ->
CanImportILTypeRef env m tspec.TypeRef
- && tspec.GenericArgs |> ILList.toList |> List.forall (CanImportILType env m)
+ && tspec.GenericArgs |> List.forall (CanImportILType env m)
| ILType.Byref ty -> CanImportILType env m ty
| ILType.Ptr ty -> CanImportILType env m ty
| ILType.FunctionPointer _ -> true
@@ -387,7 +387,7 @@ let ImportILGenericParameters amap m scoref tinst (gps: ILGenericParameterDefs)
let tptys = tps |> List.map mkTyparTy
let importInst = tinst@tptys
(tps,gps) ||> List.iter2 (fun tp gp ->
- let constraints = gp.Constraints |> ILList.toList |> List.map (fun ilty -> TyparConstraint.CoercesTo(ImportILType amap m importInst (rescopeILType scoref ilty),m) )
+ let constraints = gp.Constraints |> List.map (fun ilty -> TyparConstraint.CoercesTo(ImportILType amap m importInst (rescopeILType scoref ilty),m) )
let constraints = if gp.HasReferenceTypeConstraint then (TyparConstraint.IsReferenceType(m)::constraints) else constraints
let constraints = if gp.HasNotNullableValueTypeConstraint then (TyparConstraint.IsNonNullableStruct(m)::constraints) else constraints
let constraints = if gp.HasDefaultConstructorConstraint then (TyparConstraint.RequiresDefaultConstructor(m)::constraints) else constraints
diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs
index 21832594706..90808991999 100755
--- a/src/fsharp/infos.fs
+++ b/src/fsharp/infos.fs
@@ -134,7 +134,7 @@ let rec GetImmediateInterfacesOfType skipUnref g amap m typ =
// succeeded with more reported. There are pathological corner cases where this
// doesn't apply: e.g. for mscorlib interfaces like IComparable, but we can always
// assume those are present.
- [ for ity in tdef.Implements |> ILList.toList do
+ [ for ity in tdef.Implements do
if skipUnref = SkipUnrefInterfaces.No || CanImportILType scoref amap m ity then
yield ImportILType scoref amap m tinst ity ]
@@ -717,7 +717,7 @@ type ILMethInfo =
/// Get the Abstract IL metadata corresponding to the parameters of the method.
/// If this is an C#-style extension method then drop the object argument.
member x.ParamMetadata =
- let ps = x.RawMetadata.Parameters |> ILList.toList
+ let ps = x.RawMetadata.Parameters
if x.IsILExtensionMethod then List.tail ps else ps
/// Get the number of parameters of the method
@@ -770,7 +770,7 @@ type ILMethInfo =
/// Get all the argument types of the IL method. Include the object argument even if this is
/// an C#-style extension method.
member x.GetRawArgTypes(amap,m,minst) =
- x.RawMetadata.Parameters |> ILList.toList |> List.map (fun p -> ImportILTypeFromMetadata amap m x.MetadataScope x.DeclaringTypeInst minst p.Type)
+ x.RawMetadata.Parameters |> List.map (fun p -> ImportILTypeFromMetadata amap m x.MetadataScope x.DeclaringTypeInst minst p.Type)
/// Get info about the arguments of the IL method. If this is an C#-style extension method then
/// drop the object argument.
@@ -1712,12 +1712,12 @@ type ILPropInfo =
/// Get the names and types of the indexer arguments associated with the IL property.
member x.GetParamNamesAndTypes(amap,m) =
let (ILPropInfo (tinfo,pdef)) = x
- pdef.Args |> ILList.toList |> List.map (fun ty -> ParamNameAndType(None, ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInst [] ty) )
+ pdef.Args |> List.map (fun ty -> ParamNameAndType(None, ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInst [] ty) )
/// Get the types of the indexer arguments associated with the IL property.
member x.GetParamTypes(amap,m) =
let (ILPropInfo (tinfo,pdef)) = x
- pdef.Args |> ILList.toList |> List.map (fun ty -> ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInst [] ty)
+ pdef.Args |> List.map (fun ty -> ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInst [] ty)
/// Get the return type of the IL property.
member x.GetPropertyType (amap,m) =
diff --git a/src/fsharp/lib.fs b/src/fsharp/lib.fs
index 766f6f023f6..f9b774095c1 100755
--- a/src/fsharp/lib.fs
+++ b/src/fsharp/lib.fs
@@ -230,10 +230,6 @@ module ListSet =
// Note: if duplicates appear, keep the ones toward the _front_ of the list
let setify f l = List.foldBack (insert f) (List.rev l) [] |> List.rev
-
-module FlatListSet =
- let remove f x l = FlatList.filter (fun y -> not (f x y)) l
-
//-------------------------------------------------------------------------
// Library: pairs
//------------------------------------------------------------------------
diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs
index 799ea4af9ed..8a02b1c2161 100755
--- a/src/fsharp/tast.fs
+++ b/src/fsharp/tast.fs
@@ -3661,7 +3661,7 @@ and
and DecisionTreeTarget =
| TTarget of FlatVals * Expr * SequencePointInfoForTarget
-and Bindings = FlatList
+and Bindings = Binding list
and Binding =
| TBind of Val * Expr * SequencePointInfoForBinding
@@ -3721,9 +3721,9 @@ and TyparReprInfo = TyparReprInfo of Ident * TyparKind
and Typars = Typar list
and Exprs = Expr list
-and FlatExprs = FlatList
+and FlatExprs = Expr list
and Vals = Val list
-and FlatVals = FlatList
+and FlatVals = Val list
/// The big type of expressions.
and
diff --git a/src/ilx/EraseClosures.fs b/src/ilx/EraseClosures.fs
index 3c39ac0d8f8..d3c47ea5a9c 100644
--- a/src/ilx/EraseClosures.fs
+++ b/src/ilx/EraseClosures.fs
@@ -181,9 +181,9 @@ let mkMethSpecForClosureCall cenv (clospec: IlxClosureSpec) =
let tyargsl,argtys,rstruct = stripSupportedAbstraction clospec.FormalLambdas
if not (List.isEmpty tyargsl) then failwith "mkMethSpecForClosureCall: internal error";
let rty' = mkTyOfLambdas cenv rstruct
- let argtys' = typesOfILParamsList argtys
+ let argtys' = typesOfILParams argtys
let minst' = clospec.GenericArgs
- (mkILInstanceMethSpecInTy(clospec.ILType,"Invoke",argtys',rty',ILList.toList minst'))
+ (mkILInstanceMethSpecInTy(clospec.ILType,"Invoke",argtys',rty',minst'))
// --------------------------------------------------------------------
@@ -211,7 +211,7 @@ let mkCallFunc cenv allocLocal numThisGenParams tl apps =
let rec unwind apps =
match apps with
| Apps_tyapp (actual,rest) ->
- let rest = instAppsAux varCount (ILList.ofList [ actual ]) rest
+ let rest = instAppsAux varCount [ actual ] rest
let storers,loaders = unwind rest
[] :: storers, [] :: loaders
| Apps_app (arg,rest) ->
@@ -242,7 +242,7 @@ let mkCallFunc cenv allocLocal numThisGenParams tl apps =
let (revInstTyArgs, rest') =
(([],apps), tyargs) ||> List.fold (fun (revArgsSoFar,cs) _ ->
let actual,rest' = destTyFuncApp cs
- let rest'' = instAppsAux varCount (ILList.ofList [ actual ]) rest'
+ let rest'' = instAppsAux varCount [ actual ] rest'
((actual :: revArgsSoFar),rest''))
let instTyargs = List.rev revInstTyArgs
let precall,loaders' = computePreCall fst 0 rest' loaders
@@ -395,7 +395,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo =
{il with
Code=code;
- Locals=ILList.ofList (ILList.toList il.Locals @ (List.map (snd >> mkILLocalForFreeVar) argToFreeVarMap));
+ Locals= il.Locals @ (List.map (snd >> mkILLocalForFreeVar) argToFreeVarMap)
(* maxstack may increase by 1 due to environment loads *)
MaxStack=il.MaxStack+1 }
@@ -438,7 +438,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo =
// that it is the code for a closure...
let nowCode =
mkILMethodBody
- (false,emptyILLocals,nowFields.Length + 1,
+ (false,[],nowFields.Length + 1,
nonBranchingInstrsToCode
begin
// Load up the environment, including self...
@@ -481,7 +481,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo =
{ Name = td.Name;
GenericParams= td.GenericParams;
Access=td.Access;
- Implements = ILList.empty;
+ Implements = List.empty;
IsAbstract = false;
NestedTypes = emptyILTypeDefs;
IsSealed = false;
@@ -524,7 +524,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo =
// This is the code which will first get called.
let nowCode =
mkILMethodBody
- (false,emptyILLocals,argToFreeVarMap.Length + nowFields.Length,
+ (false,[],argToFreeVarMap.Length + nowFields.Length,
nonBranchingInstrsToCode
begin
// Load up the environment
@@ -560,7 +560,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo =
// CASE 2b - Build an Term Application Apply method
// CASE 2b2. Build a term application as a virtual method.
- let nowEnvParentClass = typ_Func cenv (typesOfILParamsList nowParams) nowReturnTy
+ let nowEnvParentClass = typ_Func cenv (typesOfILParams nowParams) nowReturnTy
let cloTypeDef =
let nowApplyMethDef =
@@ -582,7 +582,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo =
{ Name = td.Name;
GenericParams= td.GenericParams;
Access = td.Access;
- Implements = mkILTypes [];
+ Implements = []
IsAbstract = false;
IsSealed = false;
IsSerializable=td.IsSerializable;
diff --git a/src/ilx/EraseUnions.fs b/src/ilx/EraseUnions.fs
index 4cae9873d59..4bf5535e441 100644
--- a/src/ilx/EraseUnions.fs
+++ b/src/ilx/EraseUnions.fs
@@ -148,7 +148,7 @@ type UnionReprDecisions<'Union,'Alt,'Type>
let baseTyOfUnionSpec (cuspec : IlxUnionSpec) =
- mkILNamedTyRaw cuspec.Boxity cuspec.TypeRef cuspec.GenericArgs
+ mkILNamedTy cuspec.Boxity cuspec.TypeRef cuspec.GenericArgs
let mkMakerName (cuspec: IlxUnionSpec) nm =
match cuspec.HasHelpers with
@@ -168,7 +168,7 @@ let cuspecRepr =
(fun cuspec -> cuspec.Boxity = ILBoxity.AsValue),
(fun (alt:IlxUnionAlternative) -> alt.Name),
(fun cuspec -> cuspec.EnclosingType),
- (fun (cuspec,nm) -> mkILNamedTyRaw cuspec.Boxity (mkILTyRefInTyRef (mkCasesTypeRef cuspec, nm)) cuspec.GenericArgs))
+ (fun (cuspec,nm) -> mkILNamedTy cuspec.Boxity (mkILTyRefInTyRef (mkCasesTypeRef cuspec, nm)) cuspec.GenericArgs))
type NoTypesGeneratedViaThisReprDecider = NoTypesGeneratedViaThisReprDecider
let cudefRepr =
@@ -192,10 +192,10 @@ let mkUnionCaseFieldId (fdef: IlxUnionField) =
let refToFieldInTy ty (nm, fldTy) = mkILFieldSpecInTy (ty, nm, fldTy)
-let formalTypeArgs (baseTy:ILType) = ILList.mapi (fun i _ -> mkILTyvarTy (uint16 i)) baseTy.GenericArgs
+let formalTypeArgs (baseTy:ILType) = List.mapi (fun i _ -> mkILTyvarTy (uint16 i)) baseTy.GenericArgs
let constFieldName nm = "_unique_" + nm
let constFormalFieldTy (baseTy:ILType) =
- mkILNamedTyRaw baseTy.Boxity baseTy.TypeRef (formalTypeArgs baseTy)
+ mkILNamedTy baseTy.Boxity baseTy.TypeRef (formalTypeArgs baseTy)
let mkConstFieldSpecFromId (baseTy:ILType) constFieldId =
refToFieldInTy baseTy constFieldId
@@ -595,7 +595,7 @@ let mkMethodsAndPropertiesForFields ilg access attr hasHelpers (typ: ILType) (fi
CallingConv=ILThisConvention.Instance
Type=field.Type
Init=None
- Args=mkILTypes []
+ Args = []
CustomAttrs= field.ILField.CustomAttrs }
|> addPropertyGeneratedAttrs ilg
)
@@ -608,7 +608,7 @@ let mkMethodsAndPropertiesForFields ilg access attr hasHelpers (typ: ILType) (fi
mkILNonGenericInstanceMethod
("get_" + adjustFieldName hasHelpers field.Name,
access, [], mkILReturn field.Type,
- mkMethodBody(true,emptyILLocals,2,nonBranchingInstrsToCode [ mkLdarg 0us; mkNormalLdfld fspec ], attr))
+ mkMethodBody(true,[],2,nonBranchingInstrsToCode [ mkLdarg 0us; mkNormalLdfld fspec ], attr))
|> addMethodGeneratedAttrs ilg ]
basicProps, basicMethods
@@ -645,7 +645,7 @@ let convAlternativeDef ilg num (td:ILTypeDef) cud info cuspec (baseTy:ILType) (a
mkILNonGenericStaticMethod
(methName,
cud.cudReprAccess,[],mkILReturn(baseTy),
- mkMethodBody(true,emptyILLocals,fields.Length,
+ mkMethodBody(true,[],fields.Length,
nonBranchingInstrsToCode
[ I_ldsfld (Nonvolatile,mkConstFieldSpec altName baseTy) ], attr))
|> addMethodGeneratedAttrs ilg
@@ -669,7 +669,7 @@ let convAlternativeDef ilg num (td:ILTypeDef) cud info cuspec (baseTy:ILType) (a
("get_" + mkTesterName altName,
cud.cudHelpersAccess,[],
mkILReturn ilg.typ_bool,
- mkMethodBody(true,emptyILLocals,2,nonBranchingInstrsToCode
+ mkMethodBody(true,[],2,nonBranchingInstrsToCode
([ mkLdarg0 ] @ mkIsData ilg (true, cuspec, num)), attr))
|> addMethodGeneratedAttrs ilg ],
[ { Name=mkTesterName altName
@@ -680,7 +680,7 @@ let convAlternativeDef ilg num (td:ILTypeDef) cud info cuspec (baseTy:ILType) (a
CallingConv=ILThisConvention.Instance
Type=ilg.typ_bool
Init=None
- Args=mkILTypes []
+ Args = []
CustomAttrs=emptyILCustomAttrs }
|> addPropertyGeneratedAttrs ilg
|> addPropertyNeverAttrs ilg ]
@@ -695,7 +695,7 @@ let convAlternativeDef ilg num (td:ILTypeDef) cud info cuspec (baseTy:ILType) (a
mkILNonGenericStaticMethod
("get_" + altName,
cud.cudHelpersAccess, [], mkILReturn baseTy,
- mkMethodBody(true,emptyILLocals,fields.Length, nonBranchingInstrsToCode (convNewDataInstrInternal ilg cuspec num), attr))
+ mkMethodBody(true,[],fields.Length, nonBranchingInstrsToCode (convNewDataInstrInternal ilg cuspec num), attr))
|> addMethodGeneratedAttrs ilg
|> addAltAttribs
@@ -709,7 +709,7 @@ let convAlternativeDef ilg num (td:ILTypeDef) cud info cuspec (baseTy:ILType) (a
CallingConv=ILThisConvention.Static
Type=baseTy
Init=None
- Args=mkILTypes []
+ Args = []
CustomAttrs=emptyILCustomAttrs }
|> addPropertyGeneratedAttrs ilg
|> addPropertyNeverAttrs ilg
@@ -723,7 +723,7 @@ let convAlternativeDef ilg num (td:ILTypeDef) cud info cuspec (baseTy:ILType) (a
cud.cudHelpersAccess,
fields |> Array.map (fun fd -> mkILParamNamed (fd.LowerName, fd.Type)) |> Array.toList,
mkILReturn baseTy,
- mkMethodBody(true,emptyILLocals,fields.Length,
+ mkMethodBody(true,[],fields.Length,
nonBranchingInstrsToCode
(Array.toList (Array.mapi (fun i _ -> mkLdarg (uint16 i)) fields) @
(convNewDataInstrInternal ilg cuspec num)), attr))
@@ -758,7 +758,7 @@ let convAlternativeDef ilg num (td:ILTypeDef) cud info cuspec (baseTy:ILType) (a
else
let debugProxyTypeName = altTy.TypeSpec.Name + "@DebugTypeProxy"
- let debugProxyTy = mkILBoxedTyRaw (mkILNestedTyRef(altTy.TypeSpec.Scope,altTy.TypeSpec.Enclosing, debugProxyTypeName)) altTy.GenericArgs
+ let debugProxyTy = mkILBoxedTy (mkILNestedTyRef(altTy.TypeSpec.Scope,altTy.TypeSpec.Enclosing, debugProxyTypeName)) altTy.GenericArgs
let debugProxyFieldName = "_obj"
let debugProxyFields =
@@ -768,7 +768,7 @@ let convAlternativeDef ilg num (td:ILTypeDef) cud info cuspec (baseTy:ILType) (a
mkILCtor(ILMemberAccess.Public (* must always be public - see jared parson blog entry on implementing debugger type proxy *),
[ mkILParamNamed ("obj",altTy) ],
mkMethodBody
- (false,emptyILLocals,3,
+ (false,[],3,
nonBranchingInstrsToCode
[ yield mkLdarg0
yield mkNormalCall (mkILCtorMethSpecForTy (ilg.typ_Object,[]))
@@ -786,7 +786,7 @@ let convAlternativeDef ilg num (td:ILTypeDef) cud info cuspec (baseTy:ILType) (a
("get_" + field.Name,
ILMemberAccess.Public,[],
mkILReturn field.Type,
- mkMethodBody(true,emptyILLocals,2,
+ mkMethodBody(true,[],2,
nonBranchingInstrsToCode
[ mkLdarg0
(match td.tdKind with ILTypeDefKind.ValueType -> mkNormalLdflda | _ -> mkNormalLdfld)
@@ -806,7 +806,7 @@ let convAlternativeDef ilg num (td:ILTypeDef) cud info cuspec (baseTy:ILType) (a
CallingConv=ILThisConvention.Instance
Type=fdef.Type
Init=None
- Args=mkILTypes []
+ Args = []
CustomAttrs= fdef.ILField.CustomAttrs }
|> addPropertyGeneratedAttrs ilg)
|> Array.toList
@@ -989,7 +989,7 @@ let mkClassUnionDef ilg tref td cud =
let tagMeths,tagProps =
- let body = mkMethodBody(true,emptyILLocals,2,genWith (fun cg -> emitLdDataTagPrim ilg (Some mkLdarg0) cg (true, cuspec); cg.EmitInstr I_ret), cud.cudWhere)
+ let body = mkMethodBody(true,[],2,genWith (fun cg -> emitLdDataTagPrim ilg (Some mkLdarg0) cg (true, cuspec); cg.EmitInstr I_ret), cud.cudWhere)
// // If we are using NULL as a representation for an element of this type then we cannot
// // use an instance method
if (repr.RepresentOneAlternativeAsNull info) then
@@ -1009,7 +1009,7 @@ let mkClassUnionDef ilg tref td cud =
CallingConv=ILThisConvention.Instance
Type=tagFieldType
Init=None
- Args=mkILTypes []
+ Args = []
CustomAttrs=emptyILCustomAttrs }
|> addPropertyGeneratedAttrs ilg
|> addPropertyNeverAttrs ilg ]
@@ -1040,7 +1040,7 @@ let mkClassUnionDef ilg tref td cud =
Layout=ILTypeDefLayout.Auto
IsSpecialName=false
Encoding=ILDefaultPInvokeEncoding.Ansi
- Implements = mkILTypes []
+ Implements = []
Extends= Some ilg.typ_Object
Methods= emptyILMethods
SecurityDecls=emptyILSecurityDecls
diff --git a/tests/RunTests.cmd b/tests/RunTests.cmd
index 687719a5229..4fdeae1f792 100644
--- a/tests/RunTests.cmd
+++ b/tests/RunTests.cmd
@@ -153,36 +153,6 @@ REM ----------------------------------------------------------------------------
:FSHARP
-if not '%FSHARP_TEST_SUITE_USE_NUNIT_RUNNER%' == '' (
- goto :FSHARP_NUNIT
-)
-
-set RESULTFILE=FSharp_Results.log
-set FAILFILE=FSharp_Failures.log
-set FAILENV=FSharp_Failures
-
-rem Hosted compiler not supported for FSHARP suite
-set HOSTED_COMPILER=
-
-where.exe perl > NUL 2> NUL
-if errorlevel 1 (
- echo Error: perl is not in the PATH
- exit /b 1
-)
-
-echo perl %~dp0\fsharpqa\testenv\bin\runall.pl -resultsroot %RESULTSDIR% -results %RESULTFILE% -log %FAILFILE% -fail %FAILENV% -cleanup:yes %TTAGS_ARG% %NO_TTAGS_ARG% %PARALLEL_ARG%
- perl %~dp0\fsharpqa\testenv\bin\runall.pl -resultsroot %RESULTSDIR% -results %RESULTFILE% -log %FAILFILE% -fail %FAILENV% -cleanup:yes %TTAGS_ARG% %NO_TTAGS_ARG% %PARALLEL_ARG% -savelog:all
-)
-if errorlevel 1 (
- type %RESULTSDIR%\%FAILFILE%
- exit /b 1
-)
-goto :EOF
-
-REM ----------------------------------------------------------------------------
-
-:FSHARP_NUNIT
-
set FSHARP_TEST_SUITE_CONFIGURATION=%FLAVOR%
set XMLFILE=%RESULTSDIR%\FSharpNunit_Xml.xml