Skip to content

Commit

Permalink
Remove reshaped_reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinRansom committed May 24, 2019
1 parent 373fae6 commit 009921e
Show file tree
Hide file tree
Showing 45 changed files with 27 additions and 932 deletions.
6 changes: 0 additions & 6 deletions FSharp.Profiles.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
<DefineConstants Condition="'$(MonoPackaging)' == 'true'">$(DefineConstants);CROSS_PLATFORM_COMPILER</DefineConstants>
<DefineConstants>$(DefineConstants);ENABLE_MONO_SUPPORT</DefineConstants>
<DefineConstants>$(DefineConstants);BE_SECURITY_TRANSPARENT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_LCIDFROMCODEPAGE</DefineConstants>
</PropertyGroup>

Expand All @@ -16,17 +15,12 @@
<DefineConstants>$(DefineConstants);FX_NO_LINKEDRESOURCES</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_PDB_READER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_PDB_WRITER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_RUNTIMEENVIRONMENT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_SECURITY_PERMISSIONS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_SERVERCODEPAGES</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_SYMBOLSTORE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_SYSTEM_CONFIGURATION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WEB_CLIENT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WIN_REGISTRY</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WINFORMS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_INDENTED_TEXT_WRITER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFEMIT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFLECTION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_MSBUILD</DefineConstants>
<OtherFlags>$(OtherFlags) --simpleresolution</OtherFlags>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <!-- Tests won't run without this, at least on OSX, see https://github.com/NuGet/Home/issues/4837#issuecomment-354536302 -->
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<DefineConstants>$(DefineConstants);FX_NO_RUNTIMEENVIRONMENT</DefineConstants>
<DefineConstants>$(DefineConstants);NO_PROJECTCRACKER</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(FSharpSourcesRoot)\..\tests\service\ReshapedReflection.fs">
<Link>ReshapedReflection.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)\..\tests\service\FsUnit.fs">
<Link>FsUnit.fs</Link>
</Compile>
Expand Down
4 changes: 0 additions & 4 deletions fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<DefineConstants>$(DefineConstants);FX_NO_SYMBOLSTORE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_LINKEDRESOURCES</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_APP_DOMAINS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_RUNTIMEENVIRONMENT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WIN_REGISTRY</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_SYSTEM_CONFIGURATION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFEMIT</DefineConstants>
Expand Down Expand Up @@ -67,9 +66,6 @@
<Compile Include="$(FSharpSourcesRoot)/fsharp/Logger.fs">
<Link>Logger.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/utils/reshapedreflection.fs">
<Link>Reshaped/reshapedreflection.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/utils/sformat.fsi">
<Link>ErrorText/sformat.fsi</Link>
</Compile>
Expand Down
15 changes: 0 additions & 15 deletions src/absil/illib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ open System.Reflection
open System.Threading
open System.Runtime.CompilerServices

#if FX_RESHAPED_REFLECTION
open Microsoft.FSharp.Core.ReflectionAdapters
#endif

// Logical shift right treating int32 as unsigned integer.
// Code that uses this should probably be adjusted to use unsigned integer types.
let (>>>&) (x: int32) (n: int32) = int32 (uint32 x >>> n)
Expand Down Expand Up @@ -258,12 +254,6 @@ module Option =

module List =

//let item n xs = List.nth xs n
#if FX_RESHAPED_REFLECTION
open PrimReflectionAdapters
open Microsoft.FSharp.Core.ReflectionAdapters
#endif

let sortWithOrder (c: IComparer<'T>) elements = List.sortWith (Order.toFunction c) elements

let splitAfter n l =
Expand Down Expand Up @@ -1272,11 +1262,6 @@ type LayeredMultiMap<'Key, 'Value when 'Key : equality and 'Key : comparison>(co
[<AutoOpen>]
module Shim =

#if FX_RESHAPED_REFLECTION
open PrimReflectionAdapters
open Microsoft.FSharp.Core.ReflectionAdapters
#endif

type IFileSystem =

/// A shim over File.ReadAllBytes
Expand Down
15 changes: 0 additions & 15 deletions src/absil/ilreflect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ open FSharp.Compiler.ErrorLogger
open FSharp.Compiler.Range
open FSharp.Core.Printf

#if FX_RESHAPED_REFLECTION
open Microsoft.FSharp.Core.ReflectionAdapters
#endif

let codeLabelOrder = ComparisonIdentity.Structural<ILCodeLabel>

// Convert the output of convCustomAttr
Expand Down Expand Up @@ -661,9 +657,6 @@ let TypeBuilderInstantiationT =
ty

let typeIsNotQueryable (ty: Type) =
#if FX_RESHAPED_REFLECTION
let ty = ty.GetTypeInfo()
#endif
(ty :? TypeBuilder) || ((ty.GetType()).Equals(TypeBuilderInstantiationT))
//----------------------------------------------------------------------------
// convFieldSpec
Expand Down Expand Up @@ -792,11 +785,7 @@ let queryableTypeGetMethod cenv emEnv parentT (mref: ILMethodRef) =
parentT.GetMethod(mref.Name, cconv ||| BindingFlags.Public ||| BindingFlags.NonPublic,
null,
argTs,
#if FX_RESHAPED_REFLECTION
(null: obj[]))
#else
(null: ParameterModifier[]))
#endif
// This can fail if there is an ambiguity w.r.t. return type
with _ -> null
if (isNonNull methInfo && equalTypes resT methInfo.ReturnType) then
Expand Down Expand Up @@ -1432,11 +1421,7 @@ let buildGenParamsPass1 _emEnv defineGenericParameters (gps: ILGenericParameterD


let buildGenParamsPass1b cenv emEnv (genArgs: Type array) (gps: ILGenericParameterDefs) =
#if FX_RESHAPED_REFLECTION
let genpBs = genArgs |> Array.map (fun x -> (x.GetTypeInfo() :?> GenericTypeParameterBuilder))
#else
let genpBs = genArgs |> Array.map (fun x -> (x :?> GenericTypeParameterBuilder))
#endif
gps |> List.iteri (fun i (gp: ILGenericParameterDef) ->
let gpB = genpBs.[i]
// the Constraints are either the parent (base) type or interfaces.
Expand Down
3 changes: 0 additions & 3 deletions src/absil/ilwrite.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3035,9 +3035,6 @@ module FileSystemUtilites =
open System
open System.Reflection
open System.Globalization
#if FX_RESHAPED_REFLECTION
open Microsoft.FSharp.Core.ReflectionAdapters
#endif
let progress = try System.Environment.GetEnvironmentVariable("FSharp_DebugSetFilePermissions") <> null with _ -> false
let setExecutablePermission (filename: string) =

Expand Down
1 change: 0 additions & 1 deletion src/fsharp/FSharp.Build/FSharp.Build.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<InternalsVisibleTo Include="VisualFSharp.UnitTests" />
<EmbeddedText Include="FSBuild.txt" />
<Compile Include="..\..\utils\CompilerLocationUtils.fs" />
<Compile Include="..\..\utils\reshapedreflection.fs" />
<Compile Include="FSharpCommandLineBuilder.fs" />
<Compile Include="Fsc.fs" />
<Compile Include="Fsi.fs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

<ItemGroup>
<EmbeddedText Include="..\FSInteractiveSettings.txt" />
<Compile Include="..\..\utils\reshapedreflection.fs" />
<Compile Include="..\fsiattrs.fs" />
<Compile Include="..\fsiaux.fsi" />
<Compile Include="..\fsiaux.fs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@
<Compile Include="..\Logger.fs">
<Link>Logger.fs</Link>
</Compile>
<Compile Include="..\..\utils\reshapedreflection.fs">
<Link>Reflection\reshapedreflection.fs</Link>
</Compile>
<Compile Include="..\..\utils\reshapedmsbuild.fs">
<Link>Reflection\reshapedmsbuild.fs</Link>
</Compile>
<Compile Include="..\..\utils\sformat.fsi">
<Link>ErrorText\sformat.fsi</Link>
</Compile>
Expand Down
3 changes: 0 additions & 3 deletions src/fsharp/FSharp.Core/FSharp.Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@
<Compile Include="set.fs">
<Link>Collections/set.fs</Link>
</Compile>
<Compile Include="..\..\utils\reshapedreflection.fs">
<Link>Reflection/reshapedreflection.fs</Link>
</Compile>
<Compile Include="reflect.fsi">
<Link>Reflection/reflect.fsi</Link>
</Compile>
Expand Down
9 changes: 0 additions & 9 deletions src/fsharp/FSharp.Core/Linq.fs
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,6 @@ open Microsoft.FSharp.Quotations
open Microsoft.FSharp.Quotations.Patterns
open Microsoft.FSharp.Quotations.DerivedPatterns

#if FX_RESHAPED_REFLECTION
open PrimReflectionAdapters
open ReflectionAdapters
#endif

module LeafExpressionConverter =

// The following is recognized as a LINQ 'member initialization pattern' in a quotation.
Expand Down Expand Up @@ -219,11 +214,7 @@ module LeafExpressionConverter =
SubstHelperRaw(q, x, y) |> Expr.Cast

let showAll =
#if FX_RESHAPED_REFLECTION
true
#else
BindingFlags.Public ||| BindingFlags.NonPublic
#endif

let NullableConstructor =
typedefof<Nullable<int>>.GetConstructors().[0]
Expand Down
5 changes: 0 additions & 5 deletions src/fsharp/FSharp.Core/Query.fs
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,6 @@ open Microsoft.FSharp.Quotations.DerivedPatterns

open Microsoft.FSharp.Linq.QueryRunExtensions

#if FX_RESHAPED_REFLECTION
open PrimReflectionAdapters
open ReflectionAdapters
#endif

[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
module Query =

Expand Down
9 changes: 0 additions & 9 deletions src/fsharp/FSharp.Core/QueryExtensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ open System.Collections.Generic
open System.Linq
open System.Linq.Expressions

#if FX_RESHAPED_REFLECTION
open PrimReflectionAdapters
open ReflectionAdapters
#endif

// ----------------------------------------------------------------------------

/// A type used to reconstruct a grouping after applying a mutable->immutable mapping transformation
Expand Down Expand Up @@ -171,11 +166,7 @@ module internal Adapters =
let (|RecordFieldGetSimplification|_|) (expr:Expr) =
match expr with
| Patterns.PropertyGet(Some (Patterns.NewRecord(typ,els)),propInfo,[]) ->
#if FX_RESHAPED_REFLECTION
let fields = Microsoft.FSharp.Reflection.FSharpType.GetRecordFields(typ, true)
#else
let fields = Microsoft.FSharp.Reflection.FSharpType.GetRecordFields(typ,System.Reflection.BindingFlags.Public|||System.Reflection.BindingFlags.NonPublic)
#endif
match fields |> Array.tryFindIndex (fun p -> p = propInfo) with
| None -> None
| Some i -> if i < els.Length then Some els.[i] else None
Expand Down
11 changes: 0 additions & 11 deletions src/fsharp/FSharp.Core/array.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ namespace Microsoft.FSharp.Collections
open Microsoft.FSharp.Core.Operators
open Microsoft.FSharp.Core.CompilerServices
open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators
#if FX_RESHAPED_REFLECTION
open System.Reflection
#endif

/// Basic operations on arrays
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
Expand Down Expand Up @@ -191,11 +188,7 @@ namespace Microsoft.FSharp.Collections
[<CompiledName("CountBy")>]
let countBy (projection: 'T->'Key) (array: 'T[]) =
checkNonNull "array" array
#if FX_RESHAPED_REFLECTION
if (typeof<'Key>).GetTypeInfo().IsValueType
#else
if typeof<'Key>.IsValueType
#endif
then countByValueType projection array
else countByRefType projection array

Expand Down Expand Up @@ -445,11 +438,7 @@ namespace Microsoft.FSharp.Collections
[<CompiledName("GroupBy")>]
let groupBy (projection: 'T->'Key) (array: 'T[]) =
checkNonNull "array" array
#if FX_RESHAPED_REFLECTION
if (typeof<'Key>).GetTypeInfo().IsValueType
#else
if typeof<'Key>.IsValueType
#endif
then groupByValueType projection array
else groupByRefType projection array

Expand Down
8 changes: 0 additions & 8 deletions src/fsharp/FSharp.Core/async.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ namespace Microsoft.FSharp.Control
open Microsoft.FSharp.Control
open Microsoft.FSharp.Collections

#if FX_RESHAPED_REFLECTION
open ReflectionAdapters
#endif

type LinkedSubSource(cancellationToken: CancellationToken) =

let failureCTS = new CancellationTokenSource()
Expand Down Expand Up @@ -1701,8 +1697,6 @@ namespace Microsoft.FSharp.Control
| _ ->
None)

#if !FX_NO_WEB_CLIENT

type System.Net.WebClient with
member inline private this.Download(event: IEvent<'T, _>, handler: _ -> 'T, start, result) =
let downloadAsync =
Expand Down Expand Up @@ -1754,5 +1748,3 @@ namespace Microsoft.FSharp.Control
start = (fun userToken -> this.DownloadFileAsync(address, fileName, userToken)),
result = (fun _ -> ())
)
#endif

4 changes: 1 addition & 3 deletions src/fsharp/FSharp.Core/async.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,7 @@ namespace Microsoft.FSharp.Control
/// <returns>An asynchronous computation that waits for response to the <c>WebRequest</c>.</returns>
[<CompiledName("AsyncGetResponse")>] // give the extension member a nice, unmangled compiled name, unique within this module
member AsyncGetResponse : unit -> Async<System.Net.WebResponse>

#if !FX_NO_WEB_CLIENT

type System.Net.WebClient with

/// <summary>Returns an asynchronous computation that, when run, will wait for the download of the given URI.</summary>
Expand All @@ -761,7 +760,6 @@ namespace Microsoft.FSharp.Control
/// <returns>An asynchronous computation that will wait for the download of the URI to specified file.</returns>
[<CompiledName("AsyncDownloadFile")>] // give the extension member a nice, unmangled compiled name, unique within this module
member AsyncDownloadFile : address:System.Uri * fileName: string -> Async<unit>
#endif

// Internals used by MailboxProcessor
module internal AsyncBuilderImpl =
Expand Down
4 changes: 0 additions & 4 deletions src/fsharp/FSharp.Core/event.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ namespace Microsoft.FSharp.Control
open System.Reflection
open System.Diagnostics

#if FX_RESHAPED_REFLECTION
open ReflectionAdapters
#endif

[<CompiledName("FSharpDelegateEvent`1")>]
type DelegateEvent<'Delegate when 'Delegate :> System.Delegate>() =
let mutable multicast : System.Delegate = null
Expand Down
8 changes: 0 additions & 8 deletions src/fsharp/FSharp.Core/fslib-extra-pervasives.fs
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,13 @@ module ExtraTopLevelOperators =

[<CompiledName("CreateDictionary")>]
let dict (keyValuePairs:seq<'Key*'T>) : IDictionary<'Key,'T> =
#if FX_RESHAPED_REFLECTION
if (typeof<'Key>).GetTypeInfo().IsValueType
#else
if typeof<'Key>.IsValueType
#endif
then dictValueType keyValuePairs :> _
else dictRefType keyValuePairs :> _

[<CompiledName("CreateReadOnlyDictionary")>]
let readOnlyDict (keyValuePairs:seq<'Key*'T>) : IReadOnlyDictionary<'Key,'T> =
#if FX_RESHAPED_REFLECTION
if (typeof<'Key>).GetTypeInfo().IsValueType
#else
if typeof<'Key>.IsValueType
#endif
then dictValueType keyValuePairs :> _
else dictRefType keyValuePairs :> _

Expand Down
11 changes: 0 additions & 11 deletions src/fsharp/FSharp.Core/list.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ namespace Microsoft.FSharp.Collections
open Microsoft.FSharp.Collections
open Microsoft.FSharp.Core.CompilerServices
open System.Collections.Generic
#if FX_RESHAPED_REFLECTION
open System.Reflection
#endif

[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
[<RequireQualifiedAccess>]
Expand Down Expand Up @@ -71,11 +68,7 @@ namespace Microsoft.FSharp.Collections

[<CompiledName("CountBy")>]
let countBy (projection:'T->'Key) (list:'T list) =
#if FX_RESHAPED_REFLECTION
if (typeof<'Key>).GetTypeInfo().IsValueType
#else
if typeof<'Key>.IsValueType
#endif
then countByValueType projection list
else countByRefType projection list

Expand Down Expand Up @@ -446,11 +439,7 @@ namespace Microsoft.FSharp.Collections

[<CompiledName("GroupBy")>]
let groupBy (projection:'T->'Key) (list:'T list) =
#if FX_RESHAPED_REFLECTION
if (typeof<'Key>).GetTypeInfo().IsValueType
#else
if typeof<'Key>.IsValueType
#endif
then groupByValueType projection list
else groupByRefType projection list

Expand Down
Loading

0 comments on commit 009921e

Please sign in to comment.