diff options
author | Michal Strehovsky <michals@microsoft.com> | 2017-04-18 04:02:27 +0300 |
---|---|---|
committer | Michal Strehovsky <michals@microsoft.com> | 2017-04-18 04:02:27 +0300 |
commit | eadcda4da7b80695541b47b5304ed075b5e681e3 (patch) | |
tree | a4e158982307c4a10ceec5a9860c622711ec3782 /src/ILCompiler.MetadataTransform | |
parent | fb678ca4ae954e2375575e834d225f6c4de54642 (diff) |
Update custom attribute metadata schema to support enum arrays as element of object arrays
Four things:
* The actual schema update
* Update the CoreRT metadata emitter to emit the new schema
* Update the Project N metadata emitter to emit the new schema
* Update reflection codebase to read the new schema
Fixes dotnet/corert#3328.
[tfs-changeset: 1654618]
Diffstat (limited to 'src/ILCompiler.MetadataTransform')
-rw-r--r-- | src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs b/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs index 9e74138dc..ecf9532e7 100644 --- a/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs +++ b/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs @@ -147,7 +147,17 @@ namespace ILCompiler.Metadata { Cts.TypeDesc elementType = type.ElementType; - switch (elementType.UnderlyingType.Category) + if (elementType.IsEnum) + { + Cts.TypeSystemContext context = type.Context; + return new ConstantEnumArray + { + ElementType = HandleType(elementType), + Value = HandleCustomAttributeConstantArray(context.GetArrayType(elementType.UnderlyingType), value), + }; + } + + switch (elementType.Category) { case Cts.TypeFlags.Boolean: return new ConstantBooleanArray { Value = GetCustomAttributeConstantArrayElements<bool>(value) }; |