Skip to content

Commit 84b6da1

Browse files
authored
Merge pull request #610 from dsyme/integrate-775
Integrate Microsoft/visualfsharp --> master
2 parents 835b79c + 2843c4f commit 84b6da1

File tree

188 files changed

+6170
-6965
lines changed

Some content is hidden

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

188 files changed

+6170
-6965
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,7 @@ FSharp.Core.Nuget/*.nupkg
206206
project.lock.json
207207
Tools/
208208
Backup/
209+
tests/fsharp/core/array/dont.run.peverify
210+
tests/fsharp/core/innerpoly/dont.run.peverify
211+
tests/fsharp/typecheck/sigs/neg94-pre.dll
212+
times

.nuget/NuGet.Config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@
88
<clear />
99
<add key="dotnet-core" value="https://www.myget.org/F/dotnet-core/api/v3/index.json" />
1010
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
11-
1211
</packageSources>
1312
</configuration>

BuildToolsVersion.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

FSharp.Compiler.Tools.Nuget/FSharp.Compiler.Tools.nuspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@
4848
<!-- Microsoft.FSharp.targets : Used in the source tree as of 08/04/2016 (prior this was Microsoft.FSharp.Targets) -->
4949

5050
<file src="..\lib\release\Microsoft.FSharp.Targets" target="tools\Microsoft.FSharp.Targets" />
51+
<!--
52+
These are statically linked
5153
<file src="..\lib\release\Microsoft.DiaSymReader.dll" target="tools\Microsoft.DiaSymReader.dll" />
5254
<file src="..\lib\release\Microsoft.DiaSymReader.PortablePdb.dll" target="tools\Microsoft.DiaSymReader.PortablePdb.dll" />
5355
<file src="..\lib\release\System.Collections.Immutable.dll" target="tools\System.Collections.Immutable.dll" />
5456
<file src="..\lib\release\System.Reflection.Metadata.dll" target="tools\System.Reflection.Metadata.dll" />
57+
-->
5558
<file src="..\lib\release\Microsoft.Build.dll" target="tools\Microsoft.Build.dll" />
5659
<file src="..\lib\release\Microsoft.Build.Engine.dll" target="tools\Microsoft.Build.Engine.dll" />
5760
<file src="..\lib\release\Microsoft.Build.Framework.dll" target="tools\Microsoft.Build.Framework.dll" />

build-everything.proj

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,34 @@
4040
<ItemGroup Condition="'$(BUILD_SETUP)'=='1' or '$(BUILD_ALL)'=='1'">
4141
<SetupProjects Include="setup/fsharp-setup-build.proj" />
4242
</ItemGroup>
43-
43+
4444
<Target Name="Build">
45-
<MSBuild Projects="@(ProjectsWithDefaultFramework)" Targets="Build" BuildInParallel="true" Properties="Configuration=$(Configuration)" />
46-
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Build" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable7" />
47-
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Build" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable47" />
48-
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Build" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable78" />
49-
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Build" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable259" />
50-
<MSBuild Projects="@(ProjectsWithCoreClr)" Targets="Build" BuildInParallel="false" Properties="Configuration=$(Configuration);TargetFramework=coreclr" />
51-
<MSBuild Projects="@(SetupProjects)" Targets="Build" BuildInParallel="false" Properties="Configuration=$(Configuration)" />
45+
<MSBuild Projects="@(ProjectsWithDefaultFramework)" Targets="Build" BuildInParallel="true" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
46+
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Build" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable7;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
47+
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Build" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable47;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
48+
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Build" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable78;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
49+
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Build" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable259;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
50+
<MSBuild Projects="@(ProjectsWithCoreClr)" Targets="Build" BuildInParallel="false" Properties="Configuration=$(Configuration);TargetFramework=coreclr;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
51+
<MSBuild Projects="@(SetupProjects)" Targets="Build" BuildInParallel="false" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
5252
</Target>
5353

5454
<Target Name="Rebuild">
55-
<MSBuild Projects="@(ProjectsWithDefaultFramework)" Targets="Rebuild" BuildInParallel="true" Properties="Configuration=$(Configuration)" />
56-
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Rebuild" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable7" />
57-
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Rebuild" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable47" />
58-
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Rebuild" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable78" />
59-
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Rebuild" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable259" />
60-
<MSBuild Projects="@(ProjectsWithCoreClr)" Targets="Rebuild" BuildInParallel="false" Properties="Configuration=$(Configuration);TargetFramework=coreclr" />
61-
<MSBuild Projects="@(SetupProjects)" Targets="Rebuild" BuildInParallel="false" Properties="Configuration=$(Configuration)" />
55+
<MSBuild Projects="@(ProjectsWithDefaultFramework)" Targets="Rebuild" BuildInParallel="true" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
56+
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Rebuild" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable7;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
57+
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Rebuild" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable47;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
58+
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Rebuild" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable78;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
59+
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Rebuild" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable259;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
60+
<MSBuild Projects="@(ProjectsWithCoreClr)" Targets="Rebuild" BuildInParallel="false" Properties="Configuration=$(Configuration);TargetFramework=coreclr;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
61+
<MSBuild Projects="@(SetupProjects)" Targets="Rebuild" BuildInParallel="false" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
6262
</Target>
6363

6464
<Target Name="Clean">
65-
<MSBuild Projects="@(ProjectsWithDefaultFramework)" Targets="Clean" BuildInParallel="true" Properties="Configuration=$(Configuration)" />
66-
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Clean" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable7" />
67-
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Clean" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable47" />
68-
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Clean" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable78" />
69-
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Clean" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable259" />
70-
<MSBuild Projects="@(ProjectsWithCoreClr)" Targets="Clean" BuildInParallel="false" Properties="Configuration=$(Configuration);TargetFramework=coreclr" />
71-
<MSBuild Projects="@(SetupProjects)" Targets="Clean" BuildInParallel="false" Properties="Configuration=$(Configuration)" />
65+
<MSBuild Projects="@(ProjectsWithDefaultFramework)" Targets="Clean" BuildInParallel="true" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
66+
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Clean" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable7;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
67+
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Clean" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable47;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
68+
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Clean" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable78;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
69+
<MSBuild Projects="@(ProjectsWithPortableFramework)" Targets="Clean" BuildInParallel="true" Properties="Configuration=$(Configuration);TargetFramework=portable259;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
70+
<MSBuild Projects="@(ProjectsWithCoreClr)" Targets="Clean" BuildInParallel="false" Properties="Configuration=$(Configuration);TargetFramework=coreclr;BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
71+
<MSBuild Projects="@(SetupProjects)" Targets="Clean" BuildInParallel="false" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN)" />
7272
</Target>
7373
</Project>

build.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
@echo off
22

33
:: Check prerequisites
4-
set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
5-
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe"
6-
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
4+
set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
75
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe"
6+
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
7+
if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe"
88
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. Please see http://www.microsoft.com/en-us/download/details.aspx?id=40760. && goto :eof
99

1010
set msbuildflags=/maxcpucount

packages.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<package id="Microsoft.DiaSymReader" version="1.0.8" />
1515
<package id="FsSrGen" version="3.0.0" targetFramework="net46" />
1616
<package id="FSharp.SRGen.Build.Tasks" version="3.0.0" targetFramework="net46" />
17-
<package id="Microsoft.FSharp.Core.netcore" version="1.0.0-alpha-160629" />
17+
<package id="Microsoft.VisualFSharp.Core.Redist" version="1.0.0" />
18+
<package id="System.ValueTuple" version="4.0.0-rc3-24212-01" />
1819
</packages>

src/FSharpSource.Settings.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
</PropertyGroup>
1515
<!-- Standard interpretations of Debug and Release configurations -->
1616
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
17-
<DebugType Condition=" '$(DebugType)' == '' ">full</DebugType>
17+
<DebugType Condition=" '$(DebugType)' == '' and '$(TargetFramework)' != 'coreclr' ">full</DebugType>
18+
<DebugType Condition=" '$(DebugType)' == '' and '$(TargetFramework)' == 'coreclr' ">portable</DebugType>
1819
<Optimize Condition=" '$(Optimize)' == '' ">false</Optimize>
1920
<DefineConstants Condition=" '$(DefineConstants)' == '' ">DEBUG;TRACE</DefineConstants>
2021
<ErrorReport Condition=" '$(ErrorReport)' == '' ">prompt</ErrorReport>

src/FSharpSource.targets

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ Some other NuGET monikers to support in the future, see http://docs.nuget.org/do
7575
</PropertyGroup>
7676

7777

78-
<!-- For the proto build and exotic framework implementations, we don't use strong names. For non-exotic framework implementations, this gets adjusted below -->
7978
<PropertyGroup Condition="'$(StrongNames)' != 'true'">
8079
<DefineConstants>NO_STRONG_NAMES;$(DefineConstants)</DefineConstants>
8180
</PropertyGroup>
@@ -366,7 +365,7 @@ Some other NuGET monikers to support in the future, see http://docs.nuget.org/do
366365
<DefineConstants>$(DefineConstants);DONT_INCLUDE_DEPRECATED</DefineConstants>
367366
<DefineConstants>$(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE</DefineConstants>
368367
<DefineConstants>$(DefineConstants);QUERIES_IN_FSLIB</DefineConstants>
369-
368+
<DefineConstants>$(DefineConstants);FX_ASSEMBLYLOADBYSTRING</DefineConstants>
370369
<TargetFrameworkProfile>Profile47</TargetFrameworkProfile>
371370
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.0</TargetFrameworkVersion>
372371
</PropertyGroup>

src/absil/il.fs

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ let runningOnMono =
3838

3939
let _ = if logging then dprintn "* warning: Il.logging is on"
4040

41-
let isNil x = match x with [] -> true | _ -> false
42-
let nonNil x = match x with [] -> false | _ -> true
4341
let int_order = LanguagePrimitives.FastGenericComparer<int>
4442

4543
let notlazy v = Lazy.CreateFromValue v
@@ -86,11 +84,7 @@ let memoizeNamespaceRightTable = new ConcurrentDictionary<string,string option *
8684

8785

8886
let splitNamespace nm =
89-
let mutable res = Unchecked.defaultof<_>
90-
let ok = memoizeNamespaceTable.TryGetValue(nm,&res)
91-
if ok then res else
92-
let x = splitNamespaceAux nm
93-
(memoizeNamespaceTable.[nm] <- x; x)
87+
memoizeNamespaceTable.GetOrAdd(nm, splitNamespaceAux)
9488

9589
let splitNamespaceMemoized nm = splitNamespace nm
9690

@@ -99,12 +93,9 @@ let memoizeNamespaceArrayTable =
9993
Concurrent.ConcurrentDictionary<string,string[]>()
10094

10195
let splitNamespaceToArray nm =
102-
let mutable res = Unchecked.defaultof<_>
103-
let ok = memoizeNamespaceArrayTable.TryGetValue(nm,&res)
104-
if ok then res else
105-
let x = Array.ofList (splitNamespace nm)
106-
(memoizeNamespaceArrayTable.[nm] <- x; x)
107-
96+
memoizeNamespaceArrayTable.GetOrAdd(nm, fun nm ->
97+
let x = Array.ofList (splitNamespace nm)
98+
x)
10899

109100
let splitILTypeName (nm:string) =
110101
match nm.LastIndexOf '.' with
@@ -157,11 +148,7 @@ let splitTypeNameRightAux nm =
157148
else None, nm
158149

159150
let splitTypeNameRight nm =
160-
let mutable res = Unchecked.defaultof<_>
161-
let ok = memoizeNamespaceRightTable.TryGetValue(nm,&res)
162-
if ok then res else
163-
let x = splitTypeNameRightAux nm
164-
(memoizeNamespaceRightTable.[nm] <- x; x)
151+
memoizeNamespaceRightTable.GetOrAdd(nm, splitTypeNameRightAux)
165152

166153
// --------------------------------------------------------------------
167154
// Ordered lists with a lookup table
@@ -1987,7 +1974,7 @@ let mkILFieldRef(tref,nm,ty) = { EnclosingTypeRef=tref; Name=nm; Type=ty}
19871974
let mkILFieldSpec (tref,ty) = { FieldRef= tref; EnclosingType=ty }
19881975

19891976
let mkILFieldSpecInTy (typ:ILType,nm,fty) =
1990-
mkILFieldSpec (mkILFieldRef (typ.TypeRef,nm,fty), typ)
1977+
mkILFieldSpec (mkILFieldRef (typ.TypeRef,nm,fty), typ)
19911978

19921979
let emptyILCustomAttrs = ILAttributes (fun () -> [| |])
19931980

@@ -2650,7 +2637,7 @@ let rec rescopeILTypeSpecQuick scoref (tspec:ILTypeSpec) =
26502637
let tref = tspec.TypeRef
26512638
let tinst = tspec.GenericArgs
26522639
let qtref = qrescope_tref scoref tref
2653-
if ILList.isEmpty tinst && isNone qtref then
2640+
if ILList.isEmpty tinst && Option.isNone qtref then
26542641
None (* avoid reallocation in the common case *)
26552642
else
26562643
match qtref with
@@ -3692,12 +3679,13 @@ type ILGlobals with
36923679
mkILCustomAttribute this (mkSystemDiagnosticsDebuggableTypeRef this, [this.typ_Bool; this.typ_Bool], [ILAttribElem.Bool false; ILAttribElem.Bool jitOptimizerDisabled], [])
36933680

36943681

3695-
member this.mkDebuggableAttributeV2(ignoreSymbolStoreSequencePoints, jitOptimizerDisabled, enableEnC) =
3682+
member this.mkDebuggableAttributeV2(jitTracking, ignoreSymbolStoreSequencePoints, jitOptimizerDisabled, enableEnC) =
36963683
let tref = mkSystemDiagnosticsDebuggableTypeRef this
36973684
mkILCustomAttribute this
36983685
(tref,[mkILNonGenericValueTy (tref_DebuggableAttribute_DebuggingModes this)],
36993686
(* See System.Diagnostics.DebuggableAttribute.DebuggingModes *)
3700-
[ILAttribElem.Int32( (if jitOptimizerDisabled then 256 else 0) |||
3687+
[ILAttribElem.Int32( (if jitTracking then 1 else 0) |||
3688+
(if jitOptimizerDisabled then 256 else 0) |||
37013689
(if ignoreSymbolStoreSequencePoints then 2 else 0) |||
37023690
(if enableEnC then 4 else 0))],[])
37033691

@@ -4277,14 +4265,14 @@ let resolveILMethodRefWithRescope r td (mref:ILMethodRef) =
42774265
let nargs = args.Length
42784266
let nm = mref.Name
42794267
let possibles = td.Methods.FindByNameAndArity (nm,nargs)
4280-
if isNil possibles then failwith ("no method named "+nm+" found in type "+td.Name);
4268+
if List.isEmpty possibles then failwith ("no method named " + nm + " found in type " + td.Name)
42814269
match
42824270
possibles |> List.filter (fun md ->
42834271
mref.CallingConv = md.CallingConv &&
42844272
// REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct
4285-
(md.Parameters,mref.ArgTypes) ||> ILList.lengthsEqAndForall2 (fun p1 p2 -> r p1.Type = p2) &&
4273+
(md.Parameters,mref.ArgTypes) ||> ILList.lengthsEqAndForall2 (fun p1 p2 -> r p1.Type = p2) &&
42864274
// REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct
4287-
r md.Return.Type = mref.ReturnType) with
4275+
r md.Return.Type = mref.ReturnType) with
42884276
| [] -> failwith ("no method named "+nm+" with appropriate argument types found in type "+td.Name)
42894277
| [mdef] -> mdef
42904278
| _ -> failwith ("multiple methods named "+nm+" appear with identical argument types in type "+td.Name)

0 commit comments

Comments
 (0)