Skip to content
Closed
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
17 changes: 13 additions & 4 deletions src/Compiler/AbstractIL/il.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,7 @@ type ILDebugImport =
//| ReferenceAlias of string
//| OpenXmlNamespace of prefix: string * xmlNamespace: string

[<NoComparison; NoEquality>]
type ILDebugImports =
{
Parent: ILDebugImports option
Expand Down Expand Up @@ -1819,7 +1820,7 @@ type ILMethodVirtualInfo =
IsAbstract: bool
}

[<RequireQualifiedAccess>]
[<RequireQualifiedAccess; NoComparison>]
type MethodBody =
| IL of InterruptibleLazy<ILMethodBody>
| PInvoke of Lazy<PInvokeMethod> (* platform invoke to native *)
Expand Down Expand Up @@ -2450,6 +2451,7 @@ type ILFieldDef
override x.ToString() = "field " + x.Name

// Index table by name. Keep a canonical list to make sure field order is not disturbed for binary manipulation.
[<NoComparison; NoEquality>]
type ILFieldDefs =
| ILFields of LazyOrderedMultiMap<string, ILFieldDef>

Expand All @@ -2466,6 +2468,7 @@ type ILMethodImplDef =
}

// Index table by name and arity.
[<NoComparison; NoEquality>]
type ILMethodImplDefs =
| ILMethodImpls of InterruptibleLazy<MethodImplsMap>

Expand Down Expand Up @@ -2897,13 +2900,14 @@ and [<Sealed>] ILPreTypeDefImpl(nameSpace: string list, name: string, metadataIn
Monitor.Exit(syncObj)
| _ -> store

and ILTypeDefStored =
and [<NoComparison; NoEquality>] ILTypeDefStored =
| Given of ILTypeDef
| Reader of (int32 -> ILTypeDef)
| Computed of (unit -> ILTypeDef)

let mkILTypeDefReader f = ILTypeDefStored.Reader f

[<NoComparison; NoEquality>]
type ILNestedExportedType =
{
Name: string
Expand All @@ -2917,7 +2921,7 @@ type ILNestedExportedType =

override x.ToString() = "exported type " + x.Name

and ILNestedExportedTypes =
and [<NoComparison>] ILNestedExportedTypes =
| ILNestedExportedTypes of InterruptibleLazy<Map<string, ILNestedExportedType>>

member x.AsList() =
Expand All @@ -2941,7 +2945,7 @@ and [<NoComparison; NoEquality>] ILExportedTypeOrForwarder =

override x.ToString() = "exported type " + x.Name

and ILExportedTypesAndForwarders =
and [<NoComparison>] ILExportedTypesAndForwarders =
| ILExportedTypesAndForwarders of InterruptibleLazy<Map<string, ILExportedTypeOrForwarder>>

member x.AsList() =
Expand All @@ -2962,6 +2966,7 @@ type ILResourceLocation =
| File of ILModuleRef * int32
| Assembly of ILAssemblyRef

[<NoComparison; NoEquality>]
type ILResource =
{
Name: string
Expand All @@ -2981,6 +2986,7 @@ type ILResource =

override x.ToString() = "resource " + x.Name

[<NoComparison; NoEquality>]
type ILResources =
| ILResources of ILResource list

Expand All @@ -3000,6 +3006,7 @@ type ILAssemblyLongevity =

static member Default = Unspecified

[<NoComparison; NoEquality>]
type ILAssemblyManifest =
{
Name: string
Expand Down Expand Up @@ -3035,6 +3042,7 @@ type ILNativeResource =
| In of fileName: string * linkedResourceBase: int * linkedResourceStart: int * linkedResourceLength: int
| Out of unlinkedResource: byte[]

[<NoComparison; NoEquality>]
type ILModuleDef =
{
Manifest: ILAssemblyManifest option
Expand Down Expand Up @@ -5225,6 +5233,7 @@ type ILReferences =
FieldReferences: ILFieldRef[]
}

[<NoComparison; NoEquality>]
type ILReferencesAccumulator =
{
ilg: ILGlobals
Expand Down
8 changes: 7 additions & 1 deletion src/Compiler/AbstractIL/il.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ type ILDebugImport =
/// Defines a set of opened namespace, type relevant to a code location.
///
/// Emitted to the PortablePDB format.
[<NoComparison; NoEquality>]
type ILDebugImports =
{ Parent: ILDebugImports option
Imports: ILDebugImport[] }
Expand Down Expand Up @@ -984,7 +985,7 @@ type internal ILOverridesSpec =
member MethodRef: ILMethodRef
member DeclaringType: ILType

[<RequireQualifiedAccess>]
[<RequireQualifiedAccess; NoComparison>]
type MethodBody =
| IL of InterruptibleLazy<ILMethodBody>
| PInvoke of Lazy<PInvokeMethod>
Expand All @@ -993,6 +994,7 @@ type MethodBody =
| NotAvailable

/// Generic parameters. Formal generic parameter declarations may include the bounds, if any, on the generic parameter.
[<NoComparison; NoEquality>]
type ILGenericParameterDef =
{
Name: string
Expand Down Expand Up @@ -1642,6 +1644,7 @@ type ILNestedExportedTypes =
/// this table, suitably nested inside another "ILExportedTypeOrForwarder"
/// definition.
/// these are only found in the "Nested" field of ILExportedTypeOrForwarder objects
[<NoComparison; NoEquality>]
type ILNestedExportedType =
{ Name: string
Access: ILMemberAccess
Expand Down Expand Up @@ -1697,6 +1700,7 @@ type internal ILResourceLocation =
/// - the data section of the current module (byte[] of resource given directly).
/// - in an external file in this assembly (offset given in the ILResourceLocation field).
/// - as a resources in another assembly of the same name.
[<NoComparison; NoEquality>]
type internal ILResource =
{ Name: string
Location: ILResourceLocation
Expand Down Expand Up @@ -1727,6 +1731,7 @@ type ILAssemblyLongevity =
static member Default: ILAssemblyLongevity

/// The main module of an assembly is a module plus some manifest information.
[<NoComparison; NoEquality>]
type ILAssemblyManifest =
{
Name: string
Expand Down Expand Up @@ -1788,6 +1793,7 @@ type ILNativeResource =
///
/// An assembly is built by joining together a "main" module plus
/// several auxiliary modules.
[<NoComparison; NoEquality>]
type ILModuleDef =
{
Manifest: ILAssemblyManifest option
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/AbstractIL/ilpars.fsy
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

open Internal.Utilities.Library

[<NoComparison; NoEquality>]
type ResolvedAtMethodSpecScope<'T> =
ResolvedAtMethodSpecScope of (ILGenericParameterDefs -> 'T)

Expand Down
1 change: 1 addition & 0 deletions src/Compiler/AbstractIL/ilprint.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ let tyvar_generator =

// Carry an environment because the way we print method variables
// depends on the gparams of the current scope.
[<NoComparison; NoEquality>]
type ppenv =
{
ilGlobals: ILGlobals
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/AbstractIL/ilread.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4874,6 +4874,7 @@ type ReduceMemoryFlag =
| Yes
| No

[<NoComparison; NoEquality>]
type ILReaderOptions =
{
pdbDirPath: string option
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/AbstractIL/ilread.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type MetadataOnlyFlag = Yes | No
[<RequireQualifiedAccess>]
type ReduceMemoryFlag = Yes | No

[<NoComparison; NoEquality>]
type ILReaderOptions =
{ pdbDirPath: string option

Expand Down
3 changes: 2 additions & 1 deletion src/Compiler/AbstractIL/ilreflect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ let convAssemblyRef (aref: ILAssemblyRef) =
asmName

/// The global environment.
[<NoComparison; NoEquality>]
type cenv =
{
ilg: ILGlobals
Expand Down Expand Up @@ -512,7 +513,7 @@ let convTypeRefAux (cenv: cenv) (tref: ILTypeRef) =

/// The (local) emitter env (state). Some of these fields are effectively global accumulators
/// and could be placed as hash tables in the global environment.
[<AutoSerializable(false)>]
[<AutoSerializable(false); NoComparison; NoEquality>]
type ILDynamicAssemblyEmitEnv =
{
emTypMap: Zmap<ILTypeRef, Type * TypeBuilder * ILTypeDef * Type option>
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/AbstractIL/ilreflect.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ open FSharp.Compiler.AbstractIL.IL
val mkDynamicAssemblyAndModule:
assemblyName: string * optimize: bool * collectible: bool -> AssemblyBuilder * ModuleBuilder

[<NoComparison; NoEquality>]
type cenv =
{ ilg: ILGlobals
emitTailcalls: bool
Expand Down
2 changes: 2 additions & 0 deletions src/Compiler/AbstractIL/ilwrite.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,7 @@ let CodeBufferCapacity = 200
/// - possible branch destinations
/// - locations of embedded handles into the string table
/// - the exception table
[<NoComparison>]
type CodeBuffer =
{
code: ByteBuffer
Expand Down Expand Up @@ -3804,6 +3805,7 @@ let writePdb (
reportTime "Finish"
pdbBytes

[<NoComparison; NoEquality>]
type options =
{ ilg: ILGlobals
outfile: string
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/AbstractIL/ilwrite.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ open FSharp.Compiler.AbstractIL.IL
open FSharp.Compiler.AbstractIL.ILPdbWriter
open FSharp.Compiler.AbstractIL.StrongNameSign

[<NoComparison; NoEquality>]
type options =
{ ilg: ILGlobals
outfile: string
Expand Down
10 changes: 9 additions & 1 deletion src/Compiler/AbstractIL/ilx.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type IlxUnionCaseField(fd: ILFieldDef) =

override x.ToString() = x.Name

[<NoComparison; NoEquality>]
type IlxUnionCase =
{
altName: string
Expand All @@ -51,8 +52,10 @@ type IlxUnionHasHelpers =
| SpecialFSharpListHelpers
| SpecialFSharpOptionHelpers

[<NoComparison; NoEquality>]
type IlxUnionRef = IlxUnionRef of boxity: ILBoxity * ILTypeRef * IlxUnionCase[] * bool (* hasHelpers: *) * IlxUnionHasHelpers

[<NoComparison; NoEquality>]
type IlxUnionSpec =
| IlxUnionSpec of IlxUnionRef * ILGenericArgs

Expand Down Expand Up @@ -80,6 +83,7 @@ type IlxUnionSpec =

override x.ToString() = x.TypeRef.Name

[<NoComparison; NoEquality>]
type IlxClosureLambdas =
| Lambdas_forall of ILGenericParameterDef * IlxClosureLambdas
| Lambdas_lambda of ILParameter * IlxClosureLambdas
Expand Down Expand Up @@ -124,8 +128,10 @@ let mkILFreeVar (name, compgen, ty) =
fvType = ty
}

[<NoComparison; NoEquality>]
type IlxClosureRef = IlxClosureRef of ILTypeRef * IlxClosureLambdas * IlxClosureFreeVar[]

[<NoComparison; NoEquality>]
type IlxClosureSpec =
| IlxClosureSpec of IlxClosureRef * ILGenericArgs * ILType * useStaticField: bool

Expand Down Expand Up @@ -161,7 +167,8 @@ type IlxClosureSpec =

override x.ToString() = x.TypeRef.ToString()

// Define an extension of the IL algebra of type definitions
/// Define an extension of the IL algebra of type definitions
[<NoComparison; NoEquality>]
type IlxClosureInfo =
{
cloStructure: IlxClosureLambdas
Expand All @@ -170,6 +177,7 @@ type IlxClosureInfo =
cloUseStaticField: bool
}

[<NoComparison; NoEquality>]
type IlxUnionInfo =
{
UnionCasesAccessibility: ILMemberAccess
Expand Down
9 changes: 8 additions & 1 deletion src/Compiler/AbstractIL/ilx.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type IlxUnionCaseField =
member ILField: ILFieldDef

/// Union alternative
[<NoComparison; NoEquality>]
type IlxUnionCase =
{ altName: string
altFields: IlxUnionCaseField[]
Expand All @@ -35,6 +36,7 @@ type IlxUnionHasHelpers =
| SpecialFSharpOptionHelpers

/// Union references
[<NoComparison; NoEquality>]
type IlxUnionRef =
| IlxUnionRef of
boxity: ILBoxity *
Expand All @@ -43,6 +45,7 @@ type IlxUnionRef =
bool (* IsNullPermitted *) *
IlxUnionHasHelpers (* HasHelpers *)

[<NoComparison; NoEquality>]
type IlxUnionSpec =
| IlxUnionSpec of IlxUnionRef * ILGenericArgs

Expand All @@ -69,7 +72,7 @@ type IlxUnionSpec =
// --------------------------------------------------------------------
// Closure references
// --------------------------------------------------------------------

[<NoComparison; NoEquality>]
type IlxClosureLambdas =
| Lambdas_forall of ILGenericParameterDef * IlxClosureLambdas
| Lambdas_lambda of ILParameter * IlxClosureLambdas
Expand All @@ -80,9 +83,11 @@ type IlxClosureFreeVar =
fvCompilerGenerated: bool
fvType: ILType }

[<NoComparison; NoEquality>]
type IlxClosureRef = IlxClosureRef of ILTypeRef * IlxClosureLambdas * IlxClosureFreeVar[]

/// Represents a usage of a closure
[<NoComparison; NoEquality>]
type IlxClosureSpec =
| IlxClosureSpec of IlxClosureRef * ILGenericArgs * ILType * useStaticField: bool

Expand Down Expand Up @@ -116,13 +121,15 @@ type IlxClosureApps =
| Apps_done of ILType

/// Represents a closure prior to erasure
[<NoComparison; NoEquality>]
type IlxClosureInfo =
{ cloStructure: IlxClosureLambdas
cloFreeVars: IlxClosureFreeVar[]
cloCode: InterruptibleLazy<ILMethodBody>
cloUseStaticField: bool }

/// Represents a discriminated union type prior to erasure
[<NoComparison; NoEquality>]
type IlxUnionInfo =
{
/// Is the representation public?
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/Checking/AttributeChecking.fs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ let rec private evalFSharpAttribArg g attribExpr =
// TODO: | TypeDefOfExpr g ty
| _ -> fail()

[<NoComparison; NoEquality>]
type AttribInfo =
| FSAttribInfo of TcGlobals * Attrib
| ILAttribInfo of TcGlobals * Import.ImportMap * ILScopeRef * ILAttribute * range
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/Checking/AttributeChecking.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ exception ObsoleteWarning of string * range

exception ObsoleteError of string * range

[<NoComparison; NoEquality>]
type AttribInfo =
| FSAttribInfo of TcGlobals * Attrib
| ILAttribInfo of TcGlobals * Import.ImportMap * ILScopeRef * ILAttribute * range
Expand Down
Loading