Skip to content

Assume COMPILER_PUBLIC_API #4120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<TargetFramework>netstandard1.6</TargetFramework>
<AssemblyName>FSharp.Compiler.Service</AssemblyName>
<DefineConstants>$(DefineConstants);BUILDING_WITH_LKG</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER_PUBLIC_API</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER_SERVICE_AS_DLL</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER_SERVICE</DefineConstants>
Expand Down
1 change: 0 additions & 1 deletion fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<DefineConstants>$(DefineConstants);ENABLE_MONO_SUPPORT</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER_SERVICE_AS_DLL</DefineConstants>
<DefineConstants>$(DefineConstants);COMPILER_PUBLIC_API</DefineConstants>
<DefineConstants>$(DefineConstants);NO_STRONG_NAMES</DefineConstants>
<OtherFlags>$(OtherFlags) /warnon:1182</OtherFlags>
<OtherFlags>$(OtherFlags) --times</OtherFlags>
Expand Down
4 changes: 0 additions & 4 deletions src/absil/il.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

/// The "unlinked" view of .NET metadata and code. Central to
/// to Abstract IL library
#if COMPILER_PUBLIC_API
module public Microsoft.FSharp.Compiler.AbstractIL.IL
#else
module internal Microsoft.FSharp.Compiler.AbstractIL.IL
#endif

open Internal.Utilities
open System.Collections.Generic
Expand Down
4 changes: 0 additions & 4 deletions src/absil/illib.fs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

#if COMPILER_PUBLIC_API
module public Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
#else
module internal Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
#endif
#nowarn "1178" // The struct, record or union type 'internal_instr_extension' is not structurally comparable because the type


Expand Down
3 changes: 0 additions & 3 deletions src/fsharp/AccessibilityLogic.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
/// The basic logic of private/internal/protected/InternalsVisibleTo/public accessibility
module internal Microsoft.FSharp.Compiler.AccessibilityLogic

open Internal.Utilities
open Microsoft.FSharp.Compiler.AbstractIL
open Microsoft.FSharp.Compiler.AbstractIL.IL
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.Ast
open Microsoft.FSharp.Compiler.ErrorLogger
open Microsoft.FSharp.Compiler.Infos
open Microsoft.FSharp.Compiler.Tast
Expand Down
4 changes: 0 additions & 4 deletions src/fsharp/AttributeChecking.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
/// on items from name resolution
module internal Microsoft.FSharp.Compiler.AttributeChecking

open Internal.Utilities
open Microsoft.FSharp.Compiler.AbstractIL
open Microsoft.FSharp.Compiler.AbstractIL.IL
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library

open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.AccessibilityLogic
open Microsoft.FSharp.Compiler.Ast
open Microsoft.FSharp.Compiler.Range
open Microsoft.FSharp.Compiler.ErrorLogger
open Microsoft.FSharp.Compiler.Infos
Expand Down
2 changes: 0 additions & 2 deletions src/fsharp/AugmentWithHashCompare.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
/// Generate the hash/compare functions we add to user-defined types by default.
module internal Microsoft.FSharp.Compiler.AugmentWithHashCompare

open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.AbstractIL
open Microsoft.FSharp.Compiler.AbstractIL.IL
open Microsoft.FSharp.Compiler.AbstractIL.Internal
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.Tastops
Expand Down
4 changes: 0 additions & 4 deletions src/fsharp/AugmentWithHashCompare.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
/// Generate the hash/compare functions we add to user-defined types by default.
module internal Microsoft.FSharp.Compiler.AugmentWithHashCompare

open Internal.Utilities
open Microsoft.FSharp.Compiler.AbstractIL
open Microsoft.FSharp.Compiler.AbstractIL.Internal
open Microsoft.FSharp.Compiler

open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.TcGlobals

Expand Down
1 change: 0 additions & 1 deletion src/fsharp/CheckFormatStrings.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

module internal Microsoft.FSharp.Compiler.CheckFormatStrings

open Internal.Utilities
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
open Microsoft.FSharp.Compiler.Ast
Expand Down
2 changes: 0 additions & 2 deletions src/fsharp/CheckFormatStrings.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@

module internal Microsoft.FSharp.Compiler.CheckFormatStrings

open Internal.Utilities
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.TcGlobals
open Microsoft.FSharp.Compiler.AbstractIL.Internal

val ParseFormatString : Range.range -> TcGlobals -> source: string option -> fmt: string -> bty: TType -> cty: TType -> dty: TType -> (TType * TType) * (Range.range * int) list

Expand Down
3 changes: 0 additions & 3 deletions src/fsharp/CompileOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.TastPickle
open Microsoft.FSharp.Compiler.Range
open Microsoft.FSharp.Compiler.TypeChecker
open Microsoft.FSharp.Compiler.SR
open Microsoft.FSharp.Compiler.DiagnosticMessage
open Microsoft.FSharp.Compiler.Range
open Microsoft.FSharp.Compiler.Ast
open Microsoft.FSharp.Compiler.AttributeChecking
open Microsoft.FSharp.Compiler.ErrorLogger
Expand All @@ -42,7 +40,6 @@ open Microsoft.FSharp.Compiler.Lib
open Microsoft.FSharp.Compiler.Infos
open Microsoft.FSharp.Compiler.ConstraintSolver
open Microsoft.FSharp.Compiler.ReferenceResolver
open Microsoft.FSharp.Compiler.TypeRelations
open Microsoft.FSharp.Compiler.SignatureConformance
open Microsoft.FSharp.Compiler.MethodOverrides
open Microsoft.FSharp.Compiler.NameResolution
Expand Down
7 changes: 0 additions & 7 deletions src/fsharp/CompileOps.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,14 @@ module internal Microsoft.FSharp.Compiler.CompileOps
open System
open System.Text
open System.Collections.Generic
open Internal.Utilities
open Microsoft.FSharp.Compiler.AbstractIL
open Microsoft.FSharp.Compiler.AbstractIL.IL
open Microsoft.FSharp.Compiler.AbstractIL.Internal
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.TypeChecker
open Microsoft.FSharp.Compiler.Range
open Microsoft.FSharp.Compiler.Ast
open Microsoft.FSharp.Compiler.ErrorLogger
open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.Tastops
open Microsoft.FSharp.Compiler.Lib
open Microsoft.FSharp.Compiler.Infos
open Microsoft.FSharp.Compiler.ReferenceResolver
open Microsoft.FSharp.Compiler.TcGlobals
open Microsoft.FSharp.Core.CompilerServices
#if !NO_EXTENSIONTYPING
Expand Down
6 changes: 0 additions & 6 deletions src/fsharp/CompileOptions.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@

module internal Microsoft.FSharp.Compiler.CompileOptions

open Internal.Utilities
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.AbstractIL
open Microsoft.FSharp.Compiler.AbstractIL.IL
open Microsoft.FSharp.Compiler.AbstractIL.Internal
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
open Microsoft.FSharp.Compiler.CompileOps
open Microsoft.FSharp.Compiler.ErrorLogger
open Microsoft.FSharp.Compiler.Ast
open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.Import
open Microsoft.FSharp.Compiler.Optimizer
Expand Down
11 changes: 6 additions & 5 deletions src/fsharp/ConstraintSolver.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

module internal Microsoft.FSharp.Compiler.ConstraintSolver

//-------------------------------------------------------------------------
// Incremental type inference constraint solving.
Expand Down Expand Up @@ -30,11 +29,13 @@ module internal Microsoft.FSharp.Compiler.ConstraintSolver
//
//-------------------------------------------------------------------------


module internal Microsoft.FSharp.Compiler.ConstraintSolver

open Internal.Utilities.Collections

open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.AbstractIL
open Microsoft.FSharp.Compiler.AbstractIL.Internal
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
open Microsoft.FSharp.Compiler.Ast
open Microsoft.FSharp.Compiler.ErrorLogger
Expand All @@ -58,10 +59,10 @@ open Microsoft.FSharp.Compiler.TypeRelations
// of the constraint resolution carried out by type checking.
//-------------------------------------------------------------------------

let compgen_id = mkSynId range0 unassignedTyparName
let compgenId = mkSynId range0 unassignedTyparName

let NewCompGenTypar (kind, rigid, staticReq, dynamicReq, error) =
NewTypar(kind, rigid, Typar(compgen_id, staticReq, true), error, dynamicReq, [], false, false)
NewTypar(kind, rigid, Typar(compgenId, staticReq, true), error, dynamicReq, [], false, false)

let anon_id m = mkSynId m unassignedTyparName

Expand All @@ -75,7 +76,7 @@ let NewInferenceMeasurePar () = NewCompGenTypar (TyparKind.Measure, TyparRigidit

let NewErrorTypar () = NewCompGenTypar (TyparKind.Type, TyparRigidity.Flexible, NoStaticReq, TyparDynamicReq.No, true)
let NewErrorMeasureVar () = NewCompGenTypar (TyparKind.Measure, TyparRigidity.Flexible, NoStaticReq, TyparDynamicReq.No, true)
let NewInferenceType () = mkTyparTy (NewTypar (TyparKind.Type, TyparRigidity.Flexible, Typar(compgen_id, NoStaticReq, true), false, TyparDynamicReq.No, [], false, false))
let NewInferenceType () = mkTyparTy (NewTypar (TyparKind.Type, TyparRigidity.Flexible, Typar(compgenId, NoStaticReq, true), false, TyparDynamicReq.No, [], false, false))
let NewErrorType () = mkTyparTy (NewErrorTypar ())
let NewErrorMeasure () = Measure.Var (NewErrorMeasureVar ())

Expand Down
6 changes: 0 additions & 6 deletions src/fsharp/ConstraintSolver.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
/// Solves constraints using a mutable constraint-solver state
module internal Microsoft.FSharp.Compiler.ConstraintSolver

open Internal.Utilities
open Internal.Utilities.Collections
open Microsoft.FSharp.Compiler.AbstractIL
open Microsoft.FSharp.Compiler.AbstractIL.Internal
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.AccessibilityLogic
open Microsoft.FSharp.Compiler.Ast
Expand All @@ -16,7 +11,6 @@ open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.Range
open Microsoft.FSharp.Compiler.Import
open Microsoft.FSharp.Compiler.Tastops
open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.TcGlobals
open Microsoft.FSharp.Compiler.Infos
open Microsoft.FSharp.Compiler.MethodCalls
Expand Down
9 changes: 0 additions & 9 deletions src/fsharp/DetupleArgs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,15 @@

module internal Microsoft.FSharp.Compiler.Detuple

open Internal.Utilities
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.AbstractIL
open Microsoft.FSharp.Compiler.AbstractIL.Internal
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics
open Microsoft.FSharp.Compiler.Ast
open Microsoft.FSharp.Compiler.ErrorLogger
open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.Tastops
open Microsoft.FSharp.Compiler.Tastops.DebugPrint
open Microsoft.FSharp.Compiler.TcGlobals
open Microsoft.FSharp.Compiler.Layout
open Microsoft.FSharp.Compiler.PrettyNaming
open Microsoft.FSharp.Compiler.Lib



//
// This pass has one aim.
// - to eliminate tuples allocated at call sites (due to uncurried style)
Expand Down
6 changes: 0 additions & 6 deletions src/fsharp/DetupleArgs.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@

module internal Microsoft.FSharp.Compiler.Detuple

open Internal.Utilities
open Microsoft.FSharp.Compiler.AbstractIL
open Microsoft.FSharp.Compiler.AbstractIL.Internal
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.TcGlobals



(* detuple pass: *)
val DetupleImplFile : CcuThunk -> TcGlobals -> TypedImplFile -> TypedImplFile

module GlobalUsageAnalysis =
Expand Down
10 changes: 1 addition & 9 deletions src/fsharp/ErrorLogger.fs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

#if COMPILER_PUBLIC_API
module public Microsoft.FSharp.Compiler.ErrorLogger
#else
module internal Microsoft.FSharp.Compiler.ErrorLogger
#endif

open Internal.Utilities
open Microsoft.FSharp.Compiler
Expand Down Expand Up @@ -640,11 +636,7 @@ let NormalizeErrorString (text : string) =
i <- i + delta
buf.ToString()

#if COMPILER_PUBLIC_API
type FSharpErrorSeverityOptions =
#else
type internal FSharpErrorSeverityOptions =
#endif
type public FSharpErrorSeverityOptions =
{
WarnLevel: int
GlobalWarnAsError: bool
Expand Down
2 changes: 0 additions & 2 deletions src/fsharp/FindUnsolved.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

module internal Microsoft.FSharp.Compiler.FindUnsolved

open Internal.Utilities

open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.AbstractIL.Internal
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
Expand Down
5 changes: 2 additions & 3 deletions src/fsharp/IlxGen.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ open System
open System.IO
open System.Reflection
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.AbstractIL
open Microsoft.FSharp.Compiler.AbstractIL.IL
open Microsoft.FSharp.Compiler.Tast
open Microsoft.FSharp.Compiler.TcGlobals
Expand All @@ -31,8 +30,8 @@ type internal IlxGenOptions =
/// Indicates the code is being generated in FSI.EXE and is executed immediately after code generation
/// This includes all interactively compiled code, including #load, definitions, and expressions
isInteractive : bool
// Indicates the code generated is an interactive 'it' expression. We generate a setter to allow clearing of the underlying
// storage, even though 'it' is not logically mutable
/// Indicates the code generated is an interactive 'it' expression. We generate a setter to allow clearing of the underlying
/// storage, even though 'it' is not logically mutable
isInteractiveItExpr : bool
/// Indicates that, whenever possible, use callvirt instead of call
alwaysCallVirt : bool }
Expand Down
1 change: 0 additions & 1 deletion src/fsharp/InfoReader.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
module internal Microsoft.FSharp.Compiler.InfoReader

open Microsoft.FSharp.Compiler.AbstractIL.IL
open Microsoft.FSharp.Compiler.AbstractIL.Internal
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library

open Microsoft.FSharp.Compiler
Expand Down
36 changes: 1 addition & 35 deletions src/fsharp/InnerLambdasToTopLevelFuncs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

module internal Microsoft.FSharp.Compiler.InnerLambdasToTopLevelFuncs

open Internal.Utilities
open Microsoft.FSharp.Compiler.AbstractIL
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.AbstractIL.Internal
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library

open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics
open Microsoft.FSharp.Compiler.Ast
open Microsoft.FSharp.Compiler.ErrorLogger
Expand All @@ -19,22 +16,8 @@ open Microsoft.FSharp.Compiler.Layout
open Microsoft.FSharp.Compiler.Detuple.GlobalUsageAnalysis
open Microsoft.FSharp.Compiler.Lib


let verboseTLR = false

#if TLR_LIFT
/// Turns on explicit lifting of TLR constants to toplevel
/// e.g. use true if want the TLR constants to be initialised once.
///
/// NOTE: liftTLR is incomplete and disabled
/// Approach is to filter Top* let binds whilst "under lambdas",
/// and wrap them around that expr ASAP (when get to TopLevel position).
/// However, for arity assigned public vals (not TLR at moment),
/// assumptions that their RHS are lambdas get broken since the
/// lambda can be wrapped with bindings...
let liftTLR = ref false
#endif

//-------------------------------------------------------------------------
// library helpers
//-------------------------------------------------------------------------
Expand Down Expand Up @@ -937,25 +920,8 @@ module Pass4_RewriteAssembly =
let SetPreDecs z pdt = {z with rws_preDecs=pdt}

/// collect Top* repr bindings - if needed...
#if TLR_LIFT
let LiftTopBinds isRec _penv z binds =
let isTopBind (bind: Binding) = Option.isSome bind.Var.ValReprInfo
let topBinds,otherBinds = List.partition isTopBind binds
let liftTheseBindings =
!liftTLR && // lifting enabled
not z.rws_mustinline && // can't lift bindings in a mustinline context - they would become private an not inlined
z.rws_innerLevel>0 && // only collect Top* bindings when at inner levels (else will drop them!)
not (isNil 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
z,otherBinds
else
z,binds (* not "topBinds @ otherBinds" since that has changed order... *)
#else
let LiftTopBinds _isRec _penv z binds =
z,binds
#endif

/// Wrap preDecs (in order) over an expr - use letrec/let as approp
let MakePreDec m (isRec,binds: Bindings) expr =
Expand Down
Loading