Skip to content

Commit a0db991

Browse files
authored
Improve compiler's type searching logic (dotnet#1792)
The compiler has some logic to search for known types amongst available DLLs. With this PR we get to enable several tests that uses F# Interactive on .NET Core and more tests for the F# compiler on .NET Core Some of the known-type-search logic is OK, but swathes of it are not so good, e.g. this stuff This improves the search by just having one function to do the search moving many "known types" out of Abstract IL (ILGlobals) and into the F# Compiler TcGlobals. THe advantages of this is that getting started with ILGlobals is much simpler if the set of referenced types is simpler - in particular if the small set of types known to Abstract IL are all always in the primary assembly (Int32, String, Array etc.). This is particularly important for .NET Core. I don't trust the current code to correctly find some of the more obscure types for .NET Core, since the searching was based around various assumptions for Profile 7, 78, 259. Overall this removes a fair chunk of fragile code from the compiler. Separately this refactors TcGlobals to be a class instead of a record (which requires fewer lines of code)
1 parent 413bc7a commit a0db991

54 files changed

Lines changed: 2160 additions & 3032 deletions

Some content is hidden

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

build.cmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,7 @@ if '%TEST_VS_IDEUNIT_SUITE%' == '1' (
899899
)
900900
)
901901

902+
goto :success
902903
REM ------ upload test results procedure -------------------------------------
903904

904905
:UPLOAD_TEST_RESULTS

src/absil/il.fs

Lines changed: 111 additions & 563 deletions
Large diffs are not rendered by default.

src/absil/il.fsi

Lines changed: 30 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module internal Microsoft.FSharp.Compiler.AbstractIL.IL
77
open Internal.Utilities
88
open System.Collections.Generic
99

10+
[<RequireQualifiedAccess>]
1011
type PrimaryAssembly =
1112
| Mscorlib
1213
| DotNetCore
@@ -1474,29 +1475,6 @@ val isTypeNameForGlobalFunctions: string -> bool
14741475

14751476
val ungenericizeTypeName: string -> string (* e.g. List`1 --> List *)
14761477

1477-
/// Represents the capabilities of target framework profile.
1478-
/// Different profiles may omit some types or contain them in different assemblies.
1479-
type IPrimaryAssemblyTraits =
1480-
1481-
abstract TypedReferenceTypeScopeRef : ILScopeRef option
1482-
abstract RuntimeArgumentHandleTypeScopeRef : ILScopeRef option
1483-
abstract SerializationInfoTypeScopeRef : ILScopeRef option
1484-
abstract SecurityPermissionAttributeTypeScopeRef : ILScopeRef option
1485-
abstract IDispatchConstantAttributeScopeRef : ILScopeRef option
1486-
abstract IUnknownConstantAttributeScopeRef : ILScopeRef option
1487-
abstract ArgIteratorTypeScopeRef : ILScopeRef option
1488-
abstract MarshalByRefObjectScopeRef : ILScopeRef option
1489-
abstract ThreadStaticAttributeScopeRef : ILScopeRef option
1490-
abstract SpecialNameAttributeScopeRef : ILScopeRef option
1491-
abstract ContextStaticAttributeScopeRef : ILScopeRef option
1492-
abstract NonSerializedAttributeScopeRef : ILScopeRef option
1493-
1494-
abstract SystemRuntimeInteropServicesScopeRef : Lazy<ILScopeRef option>
1495-
abstract SystemLinqExpressionsScopeRef : Lazy<ILScopeRef>
1496-
abstract SystemCollectionsScopeRef : Lazy<ILScopeRef>
1497-
abstract SystemReflectionScopeRef : Lazy<ILScopeRef>
1498-
abstract SystemDiagnosticsDebugScopeRef : Lazy<ILScopeRef>
1499-
abstract ScopeRef : ILScopeRef
15001478

15011479
// ====================================================================
15021480
// PART 2
@@ -1509,103 +1487,34 @@ type IPrimaryAssemblyTraits =
15091487
/// A table of common references to items in primary assebly (System.Runtime or mscorlib).
15101488
/// If a particular version of System.Runtime.dll has been loaded then you should
15111489
/// reference items from it via an ILGlobals for that specific version built using mkILGlobals.
1512-
[<NoEquality; NoComparison>]
1490+
[<NoEquality; NoComparison; Class>]
15131491
type ILGlobals =
1514-
{
1515-
traits : IPrimaryAssemblyTraits
1516-
primaryAssemblyName: string
1517-
noDebugData: bool
1518-
tref_Object: ILTypeRef
1519-
tspec_Object: ILTypeSpec
1520-
typ_Object: ILType
1521-
tref_String: ILTypeRef
1522-
typ_String: ILType
1523-
typ_StringBuilder: ILType
1524-
typ_AsyncCallback: ILType
1525-
typ_IAsyncResult: ILType
1526-
typ_IComparable: ILType
1527-
tref_Type: ILTypeRef
1528-
typ_Type: ILType
1529-
typ_Missing: Lazy<ILType>
1530-
typ_Activator: ILType
1531-
typ_Delegate: ILType
1532-
typ_ValueType: ILType
1533-
typ_Enum: ILType
1534-
tspec_TypedReference: ILTypeSpec option
1535-
typ_TypedReference: ILType option
1536-
typ_MulticastDelegate: ILType
1537-
typ_Array: ILType
1538-
tspec_Int64: ILTypeSpec
1539-
tspec_UInt64: ILTypeSpec
1540-
tspec_Int32: ILTypeSpec
1541-
tspec_UInt32: ILTypeSpec
1542-
tspec_Int16: ILTypeSpec
1543-
tspec_UInt16: ILTypeSpec
1544-
tspec_SByte: ILTypeSpec
1545-
tspec_Byte: ILTypeSpec
1546-
tspec_Single: ILTypeSpec
1547-
tspec_Double: ILTypeSpec
1548-
tspec_IntPtr: ILTypeSpec
1549-
tspec_UIntPtr: ILTypeSpec
1550-
tspec_Char: ILTypeSpec
1551-
tspec_Bool: ILTypeSpec
1552-
typ_int8: ILType
1553-
typ_int16: ILType
1554-
typ_int32: ILType
1555-
typ_int64: ILType
1556-
typ_uint8: ILType
1557-
typ_uint16: ILType
1558-
typ_uint32: ILType
1559-
typ_uint64: ILType
1560-
typ_float32: ILType
1561-
typ_float64: ILType
1562-
typ_bool: ILType
1563-
typ_char: ILType
1564-
typ_IntPtr: ILType
1565-
typ_UIntPtr: ILType
1566-
typ_RuntimeArgumentHandle: ILType option
1567-
typ_RuntimeTypeHandle: ILType
1568-
typ_RuntimeMethodHandle: ILType
1569-
typ_RuntimeFieldHandle: ILType
1570-
typ_Byte: ILType
1571-
typ_Int16: ILType
1572-
typ_Int32: ILType
1573-
typ_Int64: ILType
1574-
typ_SByte: ILType
1575-
typ_UInt16: ILType
1576-
typ_UInt32: ILType
1577-
typ_UInt64: ILType
1578-
typ_Single: ILType
1579-
typ_Double: ILType
1580-
typ_Bool: ILType
1581-
typ_Char: ILType
1582-
typ_SerializationInfo: ILType option
1583-
typ_StreamingContext: ILType
1584-
tref_SecurityPermissionAttribute : ILTypeRef option
1585-
tspec_Exception: ILTypeSpec
1586-
typ_Exception: ILType
1587-
mutable generatedAttribsCache: ILAttribute list
1588-
mutable debuggerBrowsableNeverAttributeCache : ILAttribute option
1589-
mutable debuggerTypeProxyAttributeCache : ILAttribute option }
1590-
1591-
with
1592-
member mkDebuggableAttribute: bool (* disable JIT optimizations *) -> ILAttribute
1593-
/// Some commonly used custom attibutes
1594-
member mkDebuggableAttributeV2 : bool (* jitTracking *) * bool (* ignoreSymbolStoreSequencePoints *) * bool (* disable JIT optimizations *) * bool (* enable EnC *) -> ILAttribute
1595-
member mkCompilerGeneratedAttribute : unit -> ILAttribute
1596-
member mkDebuggerNonUserCodeAttribute : unit -> ILAttribute
1597-
member mkDebuggerStepThroughAttribute : unit -> ILAttribute
1598-
member mkDebuggerHiddenAttribute : unit -> ILAttribute
1599-
member mkDebuggerDisplayAttribute : string -> ILAttribute
1600-
member mkDebuggerTypeProxyAttribute : ILType -> ILAttribute
1601-
member mkDebuggerBrowsableNeverAttribute : unit -> ILAttribute
1602-
1603-
/// Build the table of commonly used references given an <c>ILScopeRef</c> for system runtime assembly.
1604-
val mkILGlobals : IPrimaryAssemblyTraits -> string option -> bool -> ILGlobals
1605-
1606-
val mkMscorlibBasedTraits : ILScopeRef -> IPrimaryAssemblyTraits
1607-
1608-
val EcmaILGlobals : ILGlobals
1492+
member primaryAssemblyScopeRef : ILScopeRef
1493+
member primaryAssemblyName : string
1494+
member typ_Object: ILType
1495+
member typ_String: ILType
1496+
member typ_Type: ILType
1497+
member typ_Array: ILType
1498+
member typ_IntPtr: ILType
1499+
member typ_UIntPtr: ILType
1500+
member typ_Byte: ILType
1501+
member typ_Int16: ILType
1502+
member typ_Int32: ILType
1503+
member typ_Int64: ILType
1504+
member typ_SByte: ILType
1505+
member typ_UInt16: ILType
1506+
member typ_UInt32: ILType
1507+
member typ_UInt64: ILType
1508+
member typ_Single: ILType
1509+
member typ_Double: ILType
1510+
member typ_Bool: ILType
1511+
member typ_Char: ILType
1512+
1513+
1514+
/// Build the table of commonly used references given functions to find types in system assemblies
1515+
val mkILGlobals: ILScopeRef -> ILGlobals
1516+
1517+
val EcmaMscorlibILGlobals : ILGlobals
16091518

16101519
/// When writing a binary the fake "toplevel" type definition (called <Module>)
16111520
/// must come first. This function puts it first, and creates it in the returned
@@ -1784,7 +1693,7 @@ val mkILTypeDefForGlobalFunctions: ILGlobals -> ILMethodDefs * ILFieldDefs -> IL
17841693
/// ldtoken field valuetype '<PrivateImplementationDetails>'/'$$struct0x6000127-1' '<PrivateImplementationDetails>'::'$$method0x6000127-1'
17851694
/// call void System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class System.Array,valuetype System.RuntimeFieldHandle)
17861695
/// idiom.
1787-
val mkRawDataValueTypeDef: ILGlobals -> string * size:int32 * pack:uint16 -> ILTypeDef
1696+
val mkRawDataValueTypeDef: ILType -> string * size:int32 * pack:uint16 -> ILTypeDef
17881697

17891698
/// Injecting code into existing code blocks. A branch will
17901699
/// be added from the given instructions to the (unique) entry of
@@ -1804,7 +1713,7 @@ val mkILStorageCtor: ILSourceMarker option * ILInstr list * ILType * (string * I
18041713
val mkILSimpleStorageCtor: ILSourceMarker option * ILTypeSpec option * ILType * (string * ILType) list * ILMemberAccess -> ILMethodDef
18051714
val mkILSimpleStorageCtorWithParamNames: ILSourceMarker option * ILTypeSpec option * ILType * (string * string * ILType) list * ILMemberAccess -> ILMethodDef
18061715

1807-
val mkILDelegateMethods: ILGlobals -> ILParameter list * ILReturn -> ILMethodDef list
1716+
val mkILDelegateMethods: ILGlobals -> ILType * ILType -> ILParameter list * ILReturn -> ILMethodDef list
18081717

18091718
/// Given a delegate type definition which lies in a particular scope,
18101719
/// make a reference to its constructor.
@@ -1926,38 +1835,10 @@ val rescopeILMethodRef: ILScopeRef -> ILMethodRef -> ILMethodRef
19261835
/// the new scope.
19271836
val rescopeILFieldRef: ILScopeRef -> ILFieldRef -> ILFieldRef
19281837

1929-
19301838
//-----------------------------------------------------------------------
19311839
// The ILCode Builder utility.
19321840
//----------------------------------------------------------------------
19331841

1934-
1935-
/// buildILCode: Build code from a sequence of instructions.
1936-
///
1937-
/// e.g. "buildILCode meth resolver instrs exns locals"
1938-
///
1939-
/// This makes the basic block structure of code from more primitive
1940-
/// information, i.e. an array of instructions.
1941-
/// [meth]: for debugging and should give the name of the method.
1942-
/// [resolver]: should return the instruction indexes referred to
1943-
/// by code-label strings in the instruction stream.
1944-
/// [instrs]: the instructions themselves, perhaps with attributes giving
1945-
/// debugging information
1946-
/// [exns]: the table of exception-handling specifications
1947-
/// for the method. These are again given with respect to labels which will
1948-
/// be mapped to pc's by [resolver].
1949-
/// [locals]: the table of specifications of when local variables are live and
1950-
/// should appear in the debug info.
1951-
///
1952-
/// If the input code is well-formed, the function will returns the
1953-
/// chop up the instruction sequence into basic blocks as required for
1954-
/// the exception handlers and then return the tree-structured code
1955-
/// corresponding to the instruction stream.
1956-
/// A new set of code labels will be used throughout the resulting code.
1957-
///
1958-
/// The input can be badly formed in many ways: exception handlers might
1959-
/// overlap, or scopes of local variables may overlap badly with
1960-
/// exception handlers.
19611842
val buildILCode: string -> lab2pc: Dictionary<ILCodeLabel,int> -> instrs:ILInstr[] -> ILExceptionSpec list -> ILLocalDebugInfo list -> ILCode
19621843

19631844
// --------------------------------------------------------------------
@@ -1977,18 +1858,6 @@ val instILType: ILGenericArgs -> ILType -> ILType
19771858
/// This is a 'vendor neutral' way of referencing mscorlib.
19781859
val ecmaPublicKey: PublicKey
19791860

1980-
/// Some commonly used methods.
1981-
val mkInitializeArrayMethSpec: ILGlobals -> ILMethodSpec
1982-
1983-
val mkPrimaryAssemblyExnNewobj: ILGlobals -> string -> ILInstr
1984-
1985-
val addMethodGeneratedAttrs : ILGlobals -> ILMethodDef -> ILMethodDef
1986-
val addPropertyGeneratedAttrs : ILGlobals -> ILPropertyDef -> ILPropertyDef
1987-
val addFieldGeneratedAttrs : ILGlobals -> ILFieldDef -> ILFieldDef
1988-
1989-
val addPropertyNeverAttrs : ILGlobals -> ILPropertyDef -> ILPropertyDef
1990-
val addFieldNeverAttrs : ILGlobals -> ILFieldDef -> ILFieldDef
1991-
19921861
/// Discriminating different important built-in types.
19931862
val isILObjectTy: ILType -> bool
19941863
val isILStringTy: ILType -> bool

src/absil/ilascii.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX.Types
1212
open Microsoft.FSharp.Compiler.AbstractIL.IL
1313

1414
// set to the proper value at CompileOps.fs (BuildFrameworkTcImports)
15-
let parseILGlobals = ref EcmaILGlobals
15+
let parseILGlobals = ref EcmaMscorlibILGlobals
1616

1717
// --------------------------------------------------------------------
1818
// Table of parsing and pretty printing data for instructions.

src/absil/ilpars.fsy

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ let resolveCurrentMethodSpecScope obj =
5353

5454

5555
let findSystemRuntimeAssemblyRef() =
56-
match (!parseILGlobals).traits.ScopeRef with
56+
match (!parseILGlobals).primaryAssemblyScopeRef with
5757
| ILScopeRef.Assembly aref -> aref
5858
| _ -> pfailwith "systemRuntimeScopeRef not set to valid assembly reference in parseILGlobals"
5959

@@ -330,39 +330,39 @@ typ: STRING
330330
| typ STAR
331331
{ resolveMethodSpecScopeThen $1 (fun ty -> noMethodSpecScope (ILType.Ptr ty)) }
332332
| CHAR
333-
{ noMethodSpecScope (!parseILGlobals).typ_char }
333+
{ noMethodSpecScope (!parseILGlobals).typ_Char }
334334
| VOID
335335
{ noMethodSpecScope ILType.Void }
336336
| BOOL
337-
{ noMethodSpecScope (!parseILGlobals).typ_bool }
337+
{ noMethodSpecScope (!parseILGlobals).typ_Bool }
338338
| INT8
339-
{ noMethodSpecScope (!parseILGlobals).typ_int8 }
339+
{ noMethodSpecScope (!parseILGlobals).typ_SByte }
340340
| INT16
341-
{ noMethodSpecScope (!parseILGlobals).typ_int16 }
341+
{ noMethodSpecScope (!parseILGlobals).typ_Int16 }
342342
| INT32
343-
{ noMethodSpecScope (!parseILGlobals).typ_int32 }
343+
{ noMethodSpecScope (!parseILGlobals).typ_Int32 }
344344
| INT64
345-
{ noMethodSpecScope (!parseILGlobals).typ_int64 }
345+
{ noMethodSpecScope (!parseILGlobals).typ_Int64 }
346346
| FLOAT32
347-
{ noMethodSpecScope (!parseILGlobals).typ_float32 }
347+
{ noMethodSpecScope (!parseILGlobals).typ_Single }
348348
| FLOAT64
349-
{ noMethodSpecScope (!parseILGlobals).typ_float64 }
349+
{ noMethodSpecScope (!parseILGlobals).typ_Double }
350350
| UNSIGNED INT8
351-
{ noMethodSpecScope (!parseILGlobals).typ_uint8 }
351+
{ noMethodSpecScope (!parseILGlobals).typ_Byte }
352352
| UNSIGNED INT16
353-
{ noMethodSpecScope (!parseILGlobals).typ_uint16 }
353+
{ noMethodSpecScope (!parseILGlobals).typ_UInt16 }
354354
| UNSIGNED INT32
355-
{ noMethodSpecScope (!parseILGlobals).typ_uint32 }
355+
{ noMethodSpecScope (!parseILGlobals).typ_UInt32 }
356356
| UNSIGNED INT64
357-
{ noMethodSpecScope (!parseILGlobals).typ_uint64 }
357+
{ noMethodSpecScope (!parseILGlobals).typ_UInt64 }
358358
| UINT8
359-
{ noMethodSpecScope (!parseILGlobals).typ_uint8 }
359+
{ noMethodSpecScope (!parseILGlobals).typ_Byte }
360360
| UINT16
361-
{ noMethodSpecScope (!parseILGlobals).typ_uint16 }
361+
{ noMethodSpecScope (!parseILGlobals).typ_UInt16 }
362362
| UINT32
363-
{ noMethodSpecScope (!parseILGlobals).typ_uint32 }
363+
{ noMethodSpecScope (!parseILGlobals).typ_UInt32 }
364364
| UINT64
365-
{ noMethodSpecScope (!parseILGlobals).typ_uint64 }
365+
{ noMethodSpecScope (!parseILGlobals).typ_UInt64 }
366366
| NATIVE INT
367367
{ noMethodSpecScope (!parseILGlobals).typ_IntPtr }
368368
| NATIVE UNSIGNED INT

src/absil/ilprint.fs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -165,21 +165,20 @@ and goutput_typ env os ty =
165165

166166
| ILType.Byref typ -> goutput_typ env os typ; output_string os "&"
167167
| ILType.Ptr typ -> goutput_typ env os typ; output_string os "*"
168-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_SByte.Name -> output_string os "int8"
169-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_Int16.Name -> output_string os "int16"
170-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_Int32.Name -> output_string os "int32"
171-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_Int64.Name -> output_string os "int64"
172-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_IntPtr.Name -> output_string os "native int"
173-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_Byte.Name -> output_string os "unsigned int8"
174-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_UInt16.Name -> output_string os "unsigned int16"
175-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_UInt32.Name -> output_string os "unsigned int32"
176-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_UInt64.Name -> output_string os "unsigned int64"
177-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_UIntPtr.Name -> output_string os "native unsigned int"
178-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_Double.Name -> output_string os "float64"
179-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_Single.Name -> output_string os "float32"
180-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_Bool.Name -> output_string os "bool"
181-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_Char.Name -> output_string os "char"
182-
| ILType.Value tspec when tspec.Name = EcmaILGlobals.tspec_TypedReference.Value.Name -> output_string os "refany"
168+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_SByte.TypeSpec.Name -> output_string os "int8"
169+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_Int16.TypeSpec.Name -> output_string os "int16"
170+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_Int32.TypeSpec.Name -> output_string os "int32"
171+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_Int64.TypeSpec.Name -> output_string os "int64"
172+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_IntPtr.TypeSpec.Name -> output_string os "native int"
173+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_Byte.TypeSpec.Name -> output_string os "unsigned int8"
174+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_UInt16.TypeSpec.Name -> output_string os "unsigned int16"
175+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_UInt32.TypeSpec.Name -> output_string os "unsigned int32"
176+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_UInt64.TypeSpec.Name -> output_string os "unsigned int64"
177+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_UIntPtr.TypeSpec.Name -> output_string os "native unsigned int"
178+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_Double.TypeSpec.Name -> output_string os "float64"
179+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_Single.TypeSpec.Name -> output_string os "float32"
180+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_Bool.TypeSpec.Name -> output_string os "bool"
181+
| ILType.Value tspec when tspec.Name = EcmaMscorlibILGlobals.typ_Char.TypeSpec.Name -> output_string os "char"
183182
| ILType.Value tspec ->
184183
output_string os "value class ";
185184
goutput_tref env os tspec.TypeRef;
@@ -703,7 +702,7 @@ let rec goutput_instr env os inst =
703702
goutput_dlocref env os (mkILArrTy(typ,shape));
704703
output_string os ".ctor";
705704
let rank = shape.Rank
706-
output_parens (output_seq "," (goutput_typ env)) os (Array.toList (Array.create ( rank) EcmaILGlobals.typ_int32))
705+
output_parens (output_seq "," (goutput_typ env)) os (Array.toList (Array.create ( rank) EcmaMscorlibILGlobals.typ_Int32))
707706
| I_stelem_any (shape,dt) ->
708707
if shape = ILArrayShape.SingleDimensional then
709708
output_string os "stelem.any "; goutput_typ env os dt
@@ -712,7 +711,7 @@ let rec goutput_instr env os inst =
712711
goutput_dlocref env os (mkILArrTy(dt,shape));
713712
output_string os "Set";
714713
let rank = shape.Rank
715-
output_parens (output_seq "," (goutput_typ env)) os (Array.toList (Array.create ( rank) EcmaILGlobals.typ_int32) @ [dt])
714+
output_parens (output_seq "," (goutput_typ env)) os (Array.toList (Array.create ( rank) EcmaMscorlibILGlobals.typ_Int32) @ [dt])
716715
| I_ldelem_any (shape,tok) ->
717716
if shape = ILArrayShape.SingleDimensional then
718717
output_string os "ldelem.any "; goutput_typ env os tok
@@ -723,7 +722,7 @@ let rec goutput_instr env os inst =
723722
goutput_dlocref env os (mkILArrTy(tok,shape));
724723
output_string os "Get";
725724
let rank = shape.Rank
726-
output_parens (output_seq "," (goutput_typ env)) os (Array.toList (Array.create ( rank) EcmaILGlobals.typ_int32))
725+
output_parens (output_seq "," (goutput_typ env)) os (Array.toList (Array.create ( rank) EcmaMscorlibILGlobals.typ_Int32))
727726
| I_ldelema (ro,_,shape,tok) ->
728727
if ro = ReadonlyAddress then output_string os "readonly. ";
729728
if shape = ILArrayShape.SingleDimensional then
@@ -735,7 +734,7 @@ let rec goutput_instr env os inst =
735734
goutput_dlocref env os (mkILArrTy(tok,shape));
736735
output_string os "Address";
737736
let rank = shape.Rank
738-
output_parens (output_seq "," (goutput_typ env)) os (Array.toList (Array.create ( rank) EcmaILGlobals.typ_int32))
737+
output_parens (output_seq "," (goutput_typ env)) os (Array.toList (Array.create ( rank) EcmaMscorlibILGlobals.typ_Int32))
739738

740739
| I_box tok -> output_string os "box "; goutput_typ env os tok
741740
| I_unbox tok -> output_string os "unbox "; goutput_typ env os tok

0 commit comments

Comments
 (0)