diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-12-09 14:28:08 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-12-09 14:28:08 +0800 |
commit | 30aa97ca3d479719b78cbaaa3a1327c66d98de0c (patch) | |
tree | b27d80a099de68f0990d821e3bb2efb9800de855 /src/hir/from_ast.cpp | |
parent | 79318f8896fad735225938fc130f3a450565a162 (diff) | |
download | mrust-30aa97ca3d479719b78cbaaa3a1327c66d98de0c.tar.gz |
HIR+Trans - Handling of various enum reprs
Diffstat (limited to 'src/hir/from_ast.cpp')
-rw-r--r-- | src/hir/from_ast.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp index f413e21e..fcd7dbf2 100644 --- a/src/hir/from_ast.cpp +++ b/src/hir/from_ast.cpp @@ -917,8 +917,24 @@ namespace { if( repr_str == "C" ) { repr = ::HIR::Enum::Repr::C; } + else if( repr_str == "u8") { + repr = ::HIR::Enum::Repr::U8; + } + else if( repr_str == "u16") { + repr = ::HIR::Enum::Repr::U16; + } + else if( repr_str == "u32") { + repr = ::HIR::Enum::Repr::U32; + } + else if( repr_str == "u64") { + repr = ::HIR::Enum::Repr::U32; + } + else if( repr_str == "usize") { + repr = ::HIR::Enum::Repr::Usize; + } else { // TODO: Other repr types + ERROR(Span(), E0000, "Unknown enum repr '" << repr_str << "'"); } } data = ::HIR::Enum::Class::make_Value({ repr, mv$(variants) }); |