Skip to content

ElementType

Raymond Chen edited this page Mar 31, 2019 · 2 revisions

The xmr::ElementType enum is defined in meta_reader.h (via impl/enum.h). It describes an entity which could be a primitive type or a user-defined type.

The underlying type for ElementType is uint8_t.

Fields

Although many values are defined by ECMA-335, most of them are not legal in metadata files. If the "Xlang type" column is blank, then this value will not be reported by the metadata parser for valid metadata files, although those marked "Used internally" or "Transformed" are physically present in the metadata file but are transformed by the parser into something else, as noted.

Name Value Xlang type Notes
End 0x00 Used internally, not exposed by parser
Void 0x01 void Transformed by RetTypeSig into nullopt
Boolean 0x02 Boolean
Char 0x03 Char16
I1 0x04
U1 0x05 UInt8
I2 0x06 Int16
U2 0x07 UInt16
I4 0x08 Int32
U4 0x09 UInt32
I8 0x0A Int64
U8 0x0B UInt64
R4 0x0C Float
R8 0x0D Double
String 0x0E String
Ptr 0x0F
ByRef 0x0F Transformed by ParamSig and RetTypeSig into ByRef()
ValueType 0x11 struct
Class 0x12 runtime class
Var 0x13 Transformed by TypeSig into GenericTypeIndex
Array 0x14
GenericInst 0x15 Transformed by TypeSig into GenericTypeInstSig
TypedByRef 0x16
I (IntPtr) 0x18
U (UIntPtr) 0x19
FnPtr 0x1b
Object 0x1c Object
SZArray 0x1d Transformed by TypeSig into is_szarray()
MVar 0x1e
CModReqd 0x1f CModReqd Returned only by CustomModSig::CustomMod()
CModOpt 0x20 CModOpt Returned only by CustomModSig::CustomMod()
Internal 0x21
Modifier 0x40
Sentinel (Varargs) 0x41
Pinned 0x45
Type 0x50 Transformed by FixedArgSig into ElemSig::SystemType
TaggedObject 0x51
Field 0x53 Used internally by NamedArgSig
Property 0x54 Used internally by NamedArgSig
Enum 0x55 Transformed by NamedArgSig into ElemSig::EnumValue
Clone this wiki locally