diff options
Diffstat (limited to 'src/hir/from_ast.cpp')
-rw-r--r-- | src/hir/from_ast.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp index 4def1a41..7f25a42b 100644 --- a/src/hir/from_ast.cpp +++ b/src/hir/from_ast.cpp @@ -885,6 +885,7 @@ namespace { { ASSERT_BUG(Span(), attr_repr->has_sub_items(), "#[repr] attribute malformed, " << *attr_repr); bool is_c = false; + bool is_simd = false; bool is_packed = false; ASSERT_BUG(Span(), attr_repr->items().size() > 0, "#[repr] attribute malformed, " << *attr_repr); for( const auto& a : attr_repr->items() ) @@ -897,17 +898,26 @@ namespace { else if( repr_str == "packed" ) { is_packed = true; } + else if( repr_str == "simd" ) { + is_simd = true; + } else { TODO(a.span(), "Handle struct repr '" << repr_str << "'"); } } if( is_packed ) { + // TODO: What if `simd` is present? + // NOTE: repr(packed,C) is treated as the same as repr(packed) in mrustc struct_repr = ::HIR::Struct::Repr::Packed; } else if( is_c ) { + // TODO: What if `simd` is present? struct_repr = ::HIR::Struct::Repr::C; } + else if( is_simd ) { + struct_repr = ::HIR::Struct::Repr::Simd; + } else { } } |