diff options
author | John Hodge <tpg@ucc.asn.au> | 2018-06-30 12:30:04 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2018-06-30 12:30:04 +0800 |
commit | 98c49f19838c1049be70cfe0a8bd7852b03ecafb (patch) | |
tree | d88c88365f3f86787b38985832c6988b5f02ae93 /src/hir/from_ast.cpp | |
parent | e7fa373946f2da1a67a5f74d92191da1a13f7841 (diff) | |
download | mrust-98c49f19838c1049be70cfe0a8bd7852b03ecafb.tar.gz |
HIR Lower - Stub support repr(simd), fixes #78
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 { } } |