-
Notifications
You must be signed in to change notification settings - Fork 793
/
Copy pathil.fsi
2505 lines (2012 loc) · 80.1 KB
/
il.fsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
/// The "unlinked" view of .NET metadata and code. Central to the Abstract IL library
module rec FSharp.Compiler.AbstractIL.IL
open System
open FSharp.Compiler.IO
open System.Collections.Generic
open System.Reflection
open Internal.Utilities.Library
/// Represents the target primary assembly
[<RequireQualifiedAccess>]
type internal PrimaryAssembly =
| Mscorlib
| System_Runtime
| NetStandard
member Name: string
/// Checks if an assembly resolution may represent a primary assembly that actually contains the
/// definition of System.Object. Note that the chosen target primary assembly may not actually be the one
/// that contains the definition of System.Object - it is just the one we are choosing to emit for.
static member IsPossiblePrimaryAssembly: fileName: string -> bool
/// Represents guids
type ILGuid = byte[]
[<StructuralEquality; StructuralComparison>]
type ILPlatform =
internal
| X86
| AMD64
| IA64
| ARM
| ARM64
/// Debug info. Values of type "source" can be attached at sequence
/// points and some other locations.
[<Sealed>]
type ILSourceDocument =
static member Create:
language: ILGuid option * vendor: ILGuid option * documentType: ILGuid option * file: string -> ILSourceDocument
member Language: ILGuid option
member Vendor: ILGuid option
member DocumentType: ILGuid option
member File: string
[<Sealed>]
type internal ILDebugPoint =
static member Create:
document: ILSourceDocument * line: int * column: int * endLine: int * endColumn: int -> ILDebugPoint
member Document: ILSourceDocument
member Line: int
member Column: int
member EndLine: int
member EndColumn: int
[<StructuralEquality; StructuralComparison>]
type PublicKey =
| PublicKey of byte[]
| PublicKeyToken of byte[]
member IsKey: bool
member IsKeyToken: bool
member Key: byte[]
member KeyToken: byte[]
static member KeyAsToken: byte[] -> PublicKey
[<Struct>]
type ILVersionInfo =
val Major: uint16
val Minor: uint16
val Build: uint16
val Revision: uint16
new: major: uint16 * minor: uint16 * build: uint16 * revision: uint16 -> ILVersionInfo
[<Sealed>]
type ILAssemblyRef =
static member Create:
name: string *
hash: byte[] option *
publicKey: PublicKey option *
retargetable: bool *
version: ILVersionInfo option *
locale: string option ->
ILAssemblyRef
static member FromAssemblyName: AssemblyName -> ILAssemblyRef
member Name: string
/// The fully qualified name of the assembly reference, e.g. mscorlib, Version=1.0.3705 etc.
member QualifiedName: string
member Hash: byte[] option
member PublicKey: PublicKey option
/// CLI says this indicates if the assembly can be retargeted (at runtime) to be from a different publisher.
member Retargetable: bool
member Version: ILVersionInfo option
member Locale: string option
member EqualsIgnoringVersion: ILAssemblyRef -> bool
interface System.IComparable
[<Sealed>]
type ILModuleRef =
static member Create: name: string * hasMetadata: bool * hash: byte[] option -> ILModuleRef
member Name: string
member HasMetadata: bool
member Hash: byte[] option
interface System.IComparable
// Scope references
[<StructuralEquality; StructuralComparison; RequireQualifiedAccess>]
type ILScopeRef =
/// A reference to the type in the current module
| Local
/// A reference to a type in a module in the same assembly
| Module of ILModuleRef
/// A reference to a type in another assembly
| Assembly of ILAssemblyRef
/// A reference to a type in the primary assembly
| PrimaryAssembly
member IsLocalRef: bool
member QualifiedName: string
// Calling conventions.
//
// For nearly all purposes you simply want to use ILArgConvention.Default combined
// with ILThisConvention.Instance or ILThisConvention.Static, i.e.
// ILCallingConv.Instance == Callconv(ILThisConvention.Instance, ILArgConvention.Default): for an instance method
// ILCallingConv.Static == Callconv(ILThisConvention.Static, ILArgConvention.Default): for a static method
//
// ILThisConvention.InstanceExplicit is only used by Managed C++, and indicates
// that the 'this' pointer is actually explicit in the signature.
[<StructuralEquality; StructuralComparison; RequireQualifiedAccess>]
type ILArgConvention =
| Default
| CDecl
| StdCall
| ThisCall
| FastCall
| VarArg
[<StructuralEquality; StructuralComparison; RequireQualifiedAccess>]
type ILThisConvention =
/// accepts an implicit 'this' pointer
| Instance
/// accepts an explicit 'this' pointer
| InstanceExplicit
/// no 'this' pointer is passed
| Static
[<StructuralEquality; StructuralComparison>]
type ILCallingConv =
| Callconv of ILThisConvention * ILArgConvention
member internal IsInstance: bool
member internal IsInstanceExplicit: bool
member internal IsStatic: bool
member internal ThisConv: ILThisConvention
member internal BasicConv: ILArgConvention
static member Instance: ILCallingConv
static member Static: ILCallingConv
/// Array shapes. For most purposes the rank is the only thing that matters.
type internal ILArrayBound = int32 option
/// Lower-bound/size pairs
type internal ILArrayBounds = ILArrayBound * ILArrayBound
type ILArrayShape =
internal
| ILArrayShape of ILArrayBounds list
member Rank: int
/// Bounds for a single dimensional, zero based array
static member SingleDimensional: ILArrayShape
static member FromRank: int -> ILArrayShape
type internal ILBoxity =
| AsObject
| AsValue
type ILGenericVariance =
| NonVariant
| CoVariant
| ContraVariant
/// Type refs, i.e. references to types in some .NET assembly
[<Sealed>]
type ILTypeRef =
/// Create a ILTypeRef.
static member Create: scope: ILScopeRef * enclosing: string list * name: string -> ILTypeRef
/// Where is the type, i.e. is it in this module, in another module in this assembly or in another assembly?
member Scope: ILScopeRef
/// The list of enclosing type names for a nested type. If non-nil then the first of these also contains the namespace.
member Enclosing: string list
/// The name of the type. This also contains the namespace if Enclosing is empty.
member Name: string
/// The name of the type in the assembly using the '.' notation for nested types.
member FullName: string
/// The name of the type in the assembly using the '+' notation for nested types.
member BasicQualifiedName: string
member QualifiedName: string
member internal EqualsWithPrimaryScopeRef: ILScopeRef * obj -> bool
override ToString: unit -> string
interface System.IComparable
/// Type specs and types.
[<Sealed>]
type ILTypeSpec =
/// Create an ILTypeSpec.
static member Create: typeRef: ILTypeRef * instantiation: ILGenericArgs -> ILTypeSpec
/// Which type is being referred to?
member TypeRef: ILTypeRef
/// The type instantiation if the type is generic, otherwise empty
member GenericArgs: ILGenericArgs
/// Where is the type, i.e. is it in this module, in another module in this assembly or in another assembly?
member Scope: ILScopeRef
/// The list of enclosing type names for a nested type. If non-nil then the first of these also contains the namespace.
member Enclosing: string list
/// The name of the type. This also contains the namespace if Enclosing is empty.
member Name: string
/// The name of the type in the assembly using the '.' notation for nested types.
member FullName: string
member internal EqualsWithPrimaryScopeRef: ILScopeRef * obj -> bool
interface System.IComparable
[<RequireQualifiedAccess; StructuralEquality; StructuralComparison>]
type ILType =
/// Used only in return and pointer types.
| Void
/// Array types
| Array of ILArrayShape * ILType
/// Unboxed types, including builtin types.
| Value of ILTypeSpec
/// Reference types. Also may be used for parents of members even if for members in value types.
| Boxed of ILTypeSpec
/// Unmanaged pointers. Nb. the type is used by tools and for binding only, not by the verifier.
| Ptr of ILType
/// Managed pointers.
| Byref of ILType
/// ILCode pointers.
| FunctionPointer of ILCallingSignature
/// Reference a generic arg.
| TypeVar of uint16
/// Custom modifiers.
| Modified of
/// True if modifier is "required".
bool *
/// The class of the custom modifier.
ILTypeRef *
/// The type being modified.
ILType
member TypeSpec: ILTypeSpec
member internal Boxity: ILBoxity
member TypeRef: ILTypeRef
member IsNominal: bool
member GenericArgs: ILGenericArgs
member IsTyvar: bool
member BasicQualifiedName: string
member QualifiedName: string
[<StructuralEquality; StructuralComparison>]
type ILCallingSignature =
{ CallingConv: ILCallingConv
ArgTypes: ILTypes
ReturnType: ILType }
type InterfaceImpl =
{ Idx: int
Type: ILType
mutable CustomAttrsStored: ILAttributesStored }
member CustomAttrs: ILAttributes
static member Create: ilType: ILType * customAttrsStored: ILAttributesStored -> InterfaceImpl
static member Create: ilType: ILType -> InterfaceImpl
/// Actual generic parameters are always types.
type ILGenericArgs = ILType list
type ILTypes = ILType list
/// Formal identities of methods.
[<Sealed>]
type ILMethodRef =
/// Functional creation
static member Create:
enclosingTypeRef: ILTypeRef *
callingConv: ILCallingConv *
name: string *
genericArity: int *
argTypes: ILTypes *
returnType: ILType ->
ILMethodRef
member DeclaringTypeRef: ILTypeRef
member CallingConv: ILCallingConv
member Name: string
member GenericArity: int
member ArgCount: int
member ArgTypes: ILTypes
member ReturnType: ILType
member GetCallingSignature: unit -> ILCallingSignature
interface System.IComparable
/// Formal identities of fields.
[<StructuralEquality; StructuralComparison>]
type ILFieldRef =
{ DeclaringTypeRef: ILTypeRef
Name: string
Type: ILType }
/// The information at the callsite of a method
[<Sealed>]
type ILMethodSpec =
/// Functional creation
static member Create: ILType * ILMethodRef * ILGenericArgs -> ILMethodSpec
member MethodRef: ILMethodRef
member DeclaringType: ILType
member GenericArgs: ILGenericArgs
member CallingConv: ILCallingConv
member GenericArity: int
member Name: string
member FormalArgTypes: ILTypes
member FormalReturnType: ILType
interface System.IComparable
/// Field specs. The data given for a ldfld, stfld etc. instruction.
[<StructuralEquality; StructuralComparison>]
type ILFieldSpec =
{ FieldRef: ILFieldRef
DeclaringType: ILType }
member DeclaringTypeRef: ILTypeRef
member Name: string
member FormalType: ILType
member ActualType: ILType
/// ILCode labels. In structured code each code label refers to a basic block somewhere in the code of the method.
type internal ILCodeLabel = int
[<StructuralEquality; StructuralComparison>]
type internal ILBasicType =
| DT_R
| DT_I1
| DT_U1
| DT_I2
| DT_U2
| DT_I4
| DT_U4
| DT_I8
| DT_U8
| DT_R4
| DT_R8
| DT_I
| DT_U
| DT_REF
[<StructuralEquality; StructuralComparison; RequireQualifiedAccess>]
type internal ILToken =
| ILType of ILType
| ILMethod of ILMethodSpec
| ILField of ILFieldSpec
[<StructuralEquality; StructuralComparison; RequireQualifiedAccess>]
type internal ILConst =
| I4 of int32
| I8 of int64
| R4 of single
| R8 of double
type internal ILTailcall =
| Tailcall
| Normalcall
type internal ILAlignment =
| Aligned
| Unaligned1
| Unaligned2
| Unaligned4
type internal ILVolatility =
| Volatile
| Nonvolatile
type internal ILReadonly =
| ReadonlyAddress
| NormalAddress
type internal ILVarArgs = ILTypes option
[<StructuralEquality; StructuralComparison>]
type internal ILComparisonInstr =
| BI_beq
| BI_bge
| BI_bge_un
| BI_bgt
| BI_bgt_un
| BI_ble
| BI_ble_un
| BI_blt
| BI_blt_un
| BI_bne_un
| BI_brfalse
| BI_brtrue
/// The instruction set.
[<StructuralEquality; NoComparison>]
type internal ILInstr =
| AI_add
| AI_add_ovf
| AI_add_ovf_un
| AI_and
| AI_div
| AI_div_un
| AI_ceq
| AI_cgt
| AI_cgt_un
| AI_clt
| AI_clt_un
| AI_conv of ILBasicType
| AI_conv_ovf of ILBasicType
| AI_conv_ovf_un of ILBasicType
| AI_mul
| AI_mul_ovf
| AI_mul_ovf_un
| AI_rem
| AI_rem_un
| AI_shl
| AI_shr
| AI_shr_un
| AI_sub
| AI_sub_ovf
| AI_sub_ovf_un
| AI_xor
| AI_or
| AI_neg
| AI_not
| AI_ldnull
| AI_dup
| AI_pop
| AI_ckfinite
| AI_nop
| AI_ldc of ILBasicType * ILConst
| I_ldarg of uint16
| I_ldarga of uint16
| I_ldind of ILAlignment * ILVolatility * ILBasicType
| I_ldloc of uint16
| I_ldloca of uint16
| I_starg of uint16
| I_stind of ILAlignment * ILVolatility * ILBasicType
| I_stloc of uint16
// Control transfer
| I_br of ILCodeLabel
| I_jmp of ILMethodSpec
| I_brcmp of ILComparisonInstr * ILCodeLabel
| I_switch of ILCodeLabel list
| I_ret
// Method call
| I_call of ILTailcall * ILMethodSpec * ILVarArgs
| I_callvirt of ILTailcall * ILMethodSpec * ILVarArgs
| I_callconstraint of callvirt: bool * ILTailcall * ILType * ILMethodSpec * ILVarArgs
| I_calli of ILTailcall * ILCallingSignature * ILVarArgs
| I_ldftn of ILMethodSpec
| I_newobj of ILMethodSpec * ILVarArgs
// Exceptions
| I_throw
| I_endfinally
| I_endfilter
| I_leave of ILCodeLabel
| I_rethrow
// Object instructions
| I_ldsfld of ILVolatility * ILFieldSpec
| I_ldfld of ILAlignment * ILVolatility * ILFieldSpec
| I_ldsflda of ILFieldSpec
| I_ldflda of ILFieldSpec
| I_stsfld of ILVolatility * ILFieldSpec
| I_stfld of ILAlignment * ILVolatility * ILFieldSpec
| I_ldstr of string
| I_isinst of ILType
| I_castclass of ILType
| I_ldtoken of ILToken
| I_ldvirtftn of ILMethodSpec
// Value type instructions
| I_cpobj of ILType
| I_initobj of ILType
| I_ldobj of ILAlignment * ILVolatility * ILType
| I_stobj of ILAlignment * ILVolatility * ILType
| I_box of ILType
| I_unbox of ILType
| I_unbox_any of ILType
| I_sizeof of ILType
// Generalized array instructions. In AbsIL these instructions include
// both the single-dimensional variants (with ILArrayShape == ILArrayShape.SingleDimensional)
// and calls to the "special" multi-dimensional "methods" such as:
// newobj void string[,]::.ctor(int32, int32)
// call string string[,]::Get(int32, int32)
// call string& string[,]::Address(int32, int32)
// call void string[,]::Set(int32, int32,string)
//
// The IL reader transforms calls of this form to the corresponding
// generalized instruction with the corresponding ILArrayShape
// argument. This is done to simplify the IL and make it more uniform.
// The IL writer then reverses this when emitting the binary.
| I_ldelem of ILBasicType
| I_stelem of ILBasicType
| I_ldelema of ILReadonly * bool * ILArrayShape * ILType
| I_ldelem_any of ILArrayShape * ILType
| I_stelem_any of ILArrayShape * ILType
| I_newarr of ILArrayShape * ILType
| I_ldlen
// "System.TypedReference" related instructions: almost
// no languages produce these, though they do occur in mscorlib.dll
// System.TypedReference represents a pair of a type and a byref-pointer
// to a value of that type.
| I_mkrefany of ILType
| I_refanytype
| I_refanyval of ILType
// Debug-specific
// I_seqpoint is a fake instruction to represent a sequence point:
// the next instruction starts the execution of the
// statement covered by the given range - this is a
// dummy instruction and is not emitted
| I_break
| I_seqpoint of ILDebugPoint
// Varargs - C++ only
| I_arglist
// Local aggregates, i.e. stack allocated data (alloca): C++ only
| I_localloc
| I_cpblk of ILAlignment * ILVolatility
| I_initblk of ILAlignment * ILVolatility
// EXTENSIONS
| EI_ilzero of ILType
| EI_ldlen_multi of int32 * int32
[<RequireQualifiedAccess>]
type internal ILExceptionClause =
| Finally of (ILCodeLabel * ILCodeLabel)
| Fault of (ILCodeLabel * ILCodeLabel)
| FilterCatch of filterRange: (ILCodeLabel * ILCodeLabel) * handlerRange: (ILCodeLabel * ILCodeLabel)
| TypeCatch of ILType * (ILCodeLabel * ILCodeLabel)
[<RequireQualifiedAccess; NoEquality; NoComparison>]
type internal ILExceptionSpec =
{ Range: ILCodeLabel * ILCodeLabel
Clause: ILExceptionClause }
/// Indicates that a particular local variable has a particular source
/// language name within a given set of ranges. This does not effect local
/// variable numbering, which is global over the whole method.
[<RequireQualifiedAccess; NoEquality; NoComparison>]
type internal ILLocalDebugMapping = { LocalIndex: int; LocalName: string }
[<RequireQualifiedAccess; NoEquality; NoComparison>]
type internal ILLocalDebugInfo =
{ Range: ILCodeLabel * ILCodeLabel
DebugMappings: ILLocalDebugMapping list }
[<RequireQualifiedAccess; NoEquality; NoComparison>]
type internal ILCode =
{ Labels: Dictionary<ILCodeLabel, int>
Instrs: ILInstr[]
Exceptions: ILExceptionSpec list
Locals: ILLocalDebugInfo list }
/// Field Init
[<RequireQualifiedAccess; StructuralEquality; StructuralComparison>]
type ILFieldInit =
| String of string
| Bool of bool
| Char of uint16
| Int8 of sbyte
| Int16 of int16
| Int32 of int32
| Int64 of int64
| UInt8 of byte
| UInt16 of uint16
| UInt32 of uint32
| UInt64 of uint64
| Single of single
| Double of double
| Null
member AsObject: unit -> objnull
[<RequireQualifiedAccess; StructuralEquality; StructuralComparison>]
type internal ILNativeVariant =
| Empty
| Null
| Variant
| Currency
| Decimal
| Date
| BSTR
| LPSTR
| LPWSTR
| IUnknown
| IDispatch
| SafeArray
| Error
| HRESULT
| CArray
| UserDefined
| Record
| FileTime
| Blob
| Stream
| Storage
| StreamedObject
| StoredObject
| BlobObject
| CF
| CLSID
| Void
| Bool
| Int8
| Int16
| Int32
| Int64
| Single
| Double
| UInt8
| UInt16
| UInt32
| UInt64
| PTR
| Array of ILNativeVariant
| Vector of ILNativeVariant
| Byref of ILNativeVariant
| Int
| UInt
/// Native Types, for marshalling to the native C interface.
/// These are taken directly from the ILASM syntax.
/// Most of these are listed in the CLI ECMA-335 Spec (Partition II, 7.4).
[<RequireQualifiedAccess; StructuralEquality; StructuralComparison>]
type ILNativeType =
| Empty
| Custom of ILGuid * nativeTypeName: string * custMarshallerName: string * cookieString: byte[]
| FixedSysString of int32
| FixedArray of int32
| Currency
| LPSTR
| LPWSTR
| LPTSTR
| LPUTF8STR
| ByValStr
| TBSTR
| LPSTRUCT
| Struct
| Void
| Bool
| Int8
| Int16
| Int32
| Int64
| Single
| Double
| Byte
| UInt16
| UInt32
| UInt64
/// optional idx of parameter giving size plus optional additive i.e. num elems
| Array of ILNativeType option * (int32 * int32 option) option
| Int
| UInt
| Method
| AsAny
| BSTR
| IUnknown
| IDispatch
| Interface
| Error
| SafeArray of ILNativeVariant * string option
| ANSIBSTR
| VariantBool
/// Local variables
[<RequireQualifiedAccess; NoComparison; NoEquality>]
type internal ILLocal =
{ Type: ILType
IsPinned: bool
DebugInfo: (string * int * int) option }
type internal ILLocals = ILLocal list
/// Defines an opened namespace, type relevant to a code location.
///
/// Emitted to the PortablePDB format. Note the format supports additional variations on
/// imported things that are not yet emitted in F#.
[<RequireQualifiedAccess; NoEquality; NoComparison>]
type ILDebugImport =
/// Represents an 'open type XYZ' opening a type
| ImportType of targetType: ILType // * alias: string option
/// Represents an 'open XYZ' opening a namespace
| ImportNamespace of targetNamespace: string // * assembly: ILAssemblyRef option * alias: string option
//| ReferenceAlias of string
//| OpenXmlNamespace of prefix: string * xmlNamespace: string
/// Defines a set of opened namespace, type relevant to a code location.
///
/// Emitted to the PortablePDB format.
type ILDebugImports =
{ Parent: ILDebugImports option
Imports: ILDebugImport[] }
/// IL method bodies
[<RequireQualifiedAccess; NoComparison; NoEquality>]
type internal ILMethodBody =
{ IsZeroInit: bool
MaxStack: int32
NoInlining: bool
AggressiveInlining: bool
Locals: ILLocals
Code: ILCode
DebugRange: ILDebugPoint option
DebugImports: ILDebugImports option }
/// Member Access
[<RequireQualifiedAccess>]
type ILMemberAccess =
/// Assembly - Indicates that the method is accessible to any class of this assembly. (internal)
| Assembly
| CompilerControlled
/// FamilyAndAssembly - Indicates that the method is accessible to members of this type and its derived types that are in _this assembly only_. (private protected)
| FamilyAndAssembly
/// FamilyOrAssembly - Indicates that the method is accessible to derived classes anywhere, as well as to any class _in the assembly_. (protected internal)
| FamilyOrAssembly
/// Family - Indicates that the method is accessible only to members of this class and its derived classes. (protected)
| Family
| Private
| Public
[<RequireQualifiedAccess>]
type ILAttribElem =
/// Represents a custom attribute parameter of type 'string'. These may be null, in which case they are encoded in a special
/// way as indicated by Ecma-335 Partition II.
| String of string option
| Bool of bool
| Char of char
| SByte of sbyte
| Int16 of int16
| Int32 of int32
| Int64 of int64
| Byte of byte
| UInt16 of uint16
| UInt32 of uint32
| UInt64 of uint64
| Single of single
| Double of double
| Null
| Type of ILType option
| TypeRef of ILTypeRef option
| Array of ILType * ILAttribElem list
/// Named args: values and flags indicating if they are fields or properties.
type ILAttributeNamedArg = string * ILType * bool * ILAttribElem
/// Custom attribute.
type ILAttribute =
/// Attribute with args encoded to a binary blob according to ECMA-335 II.21 and II.23.3.
/// 'decodeILAttribData' is used to parse the byte[] blob to ILAttribElem's as best as possible.
| Encoded of method: ILMethodSpec * data: byte[] * elements: ILAttribElem list
/// Attribute with args in decoded form.
| Decoded of method: ILMethodSpec * fixedArgs: ILAttribElem list * namedArgs: ILAttributeNamedArg list
/// Attribute instance constructor.
member internal Method: ILMethodSpec
/// Decoded arguments. May be empty in encoded attribute form.
member internal Elements: ILAttribElem list
member internal WithMethod: method: ILMethodSpec -> ILAttribute
[<NoEquality; NoComparison; Struct>]
type ILAttributes =
member AsArray: unit -> ILAttribute[]
member AsList: unit -> ILAttribute list
static member internal Empty: ILAttributes
/// Represents the efficiency-oriented storage of ILAttributes in another item.
[<NoEquality; NoComparison>]
type ILAttributesStored =
/// Computed by ilread.fs based on metadata index
| Reader of (int32 -> ILAttribute[])
/// Already computed
| Given of ILAttributes
member GetCustomAttrs: int32 -> ILAttributes
/// Method parameters and return values.
[<RequireQualifiedAccess; NoEquality; NoComparison>]
type ILParameter =
{
Name: string option
Type: ILType
Default: ILFieldInit option
/// Marshalling map for parameters. COM Interop only.
Marshal: ILNativeType option
IsIn: bool
IsOut: bool
IsOptional: bool
CustomAttrsStored: ILAttributesStored
MetadataIndex: int32
}
member CustomAttrs: ILAttributes
type ILParameters = ILParameter list
val internal typesOfILParams: ILParameters -> ILType list
/// Method return values.
[<RequireQualifiedAccess; NoEquality; NoComparison>]
type ILReturn =
{ Marshal: ILNativeType option
Type: ILType
CustomAttrsStored: ILAttributesStored
MetadataIndex: int32 }
member CustomAttrs: ILAttributes
member WithCustomAttrs: customAttrs: ILAttributes -> ILReturn
[<RequireQualifiedAccess>]
type internal ILSecurityAction =
| Request
| Demand
| Assert
| Deny
| PermitOnly
| LinkCheck
| InheritCheck
| ReqMin
| ReqOpt
| ReqRefuse
| PreJitGrant
| PreJitDeny
| NonCasDemand
| NonCasLinkDemand
| NonCasInheritance
| LinkDemandChoice
| InheritanceDemandChoice
| DemandChoice
type internal ILSecurityDecl = ILSecurityDecl of ILSecurityAction * byte[]
/// Abstract type equivalent to ILSecurityDecl list - use helpers
/// below to construct/destruct these.
[<NoComparison; NoEquality; Struct>]
type internal ILSecurityDecls =
member AsList: unit -> ILSecurityDecl list
/// Represents the efficiency-oriented storage of ILSecurityDecls in another item.
[<NoEquality; NoComparison>]
type ILSecurityDeclsStored
/// PInvoke attributes.
[<RequireQualifiedAccess>]
type internal PInvokeCallingConvention =
| None
| Cdecl
| Stdcall
| Thiscall
| Fastcall
| WinApi
[<RequireQualifiedAccess>]
type internal PInvokeCharEncoding =
| None
| Ansi
| Unicode
| Auto
[<RequireQualifiedAccess>]
type internal PInvokeCharBestFit =
| UseAssembly
| Enabled
| Disabled
[<RequireQualifiedAccess>]
type internal PInvokeThrowOnUnmappableChar =
| UseAssembly
| Enabled
| Disabled
[<RequireQualifiedAccess; NoComparison; NoEquality>]
type internal PInvokeMethod =
{ Where: ILModuleRef
Name: string
CallingConv: PInvokeCallingConvention
CharEncoding: PInvokeCharEncoding
NoMangle: bool
LastError: bool
ThrowOnUnmappableChar: PInvokeThrowOnUnmappableChar
CharBestFit: PInvokeCharBestFit }
/// Represents a reference to a method declaration in a superclass or interface.
type internal ILOverridesSpec =
| OverridesSpec of ILMethodRef * ILType