mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Combine aarch64 and non-aarch64 mono size assertions
This commit is contained in:
parent
49aea9d639
commit
489fb31cc2
2 changed files with 15 additions and 13 deletions
|
@ -52,13 +52,6 @@ pub fn pretty_print_ir_symbols() -> bool {
|
|||
// please change it to the lower number.
|
||||
// if it went up, maybe check that the change is really required
|
||||
|
||||
roc_error_macros::assert_sizeof_aarch64!(Literal, 3 * 8);
|
||||
roc_error_macros::assert_sizeof_aarch64!(Expr, 10 * 8);
|
||||
roc_error_macros::assert_sizeof_aarch64!(Stmt, 19 * 8);
|
||||
roc_error_macros::assert_sizeof_aarch64!(ProcLayout, 6 * 8);
|
||||
roc_error_macros::assert_sizeof_aarch64!(Call, 7 * 8);
|
||||
roc_error_macros::assert_sizeof_aarch64!(CallType, 5 * 8);
|
||||
|
||||
roc_error_macros::assert_sizeof_wasm!(Literal, 24);
|
||||
roc_error_macros::assert_sizeof_wasm!(Expr, 48);
|
||||
roc_error_macros::assert_sizeof_wasm!(Stmt, 120);
|
||||
|
@ -66,12 +59,12 @@ roc_error_macros::assert_sizeof_wasm!(ProcLayout, 32);
|
|||
roc_error_macros::assert_sizeof_wasm!(Call, 36);
|
||||
roc_error_macros::assert_sizeof_wasm!(CallType, 28);
|
||||
|
||||
roc_error_macros::assert_sizeof_default!(Literal, 3 * 8);
|
||||
roc_error_macros::assert_sizeof_default!(Expr, 10 * 8);
|
||||
roc_error_macros::assert_sizeof_default!(Stmt, 19 * 8);
|
||||
roc_error_macros::assert_sizeof_default!(ProcLayout, 6 * 8);
|
||||
roc_error_macros::assert_sizeof_default!(Call, 7 * 8);
|
||||
roc_error_macros::assert_sizeof_default!(CallType, 5 * 8);
|
||||
roc_error_macros::assert_sizeof_non_wasm!(Literal, 3 * 8);
|
||||
roc_error_macros::assert_sizeof_non_wasm!(Expr, 10 * 8);
|
||||
roc_error_macros::assert_sizeof_non_wasm!(Stmt, 19 * 8);
|
||||
roc_error_macros::assert_sizeof_non_wasm!(ProcLayout, 6 * 8);
|
||||
roc_error_macros::assert_sizeof_non_wasm!(Call, 7 * 8);
|
||||
roc_error_macros::assert_sizeof_non_wasm!(CallType, 5 * 8);
|
||||
|
||||
macro_rules! return_on_layout_error {
|
||||
($env:expr, $layout_result:expr) => {
|
||||
|
|
|
@ -66,6 +66,15 @@ macro_rules! assert_sizeof_all {
|
|||
};
|
||||
}
|
||||
|
||||
/// Assert that a type has the expected size on all targets except wasm
|
||||
#[macro_export]
|
||||
macro_rules! assert_sizeof_non_wasm {
|
||||
($t: ty, $expected_size: expr) => {
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
static_assertions::assert_eq_size!($t, [u8; $expected_size]);
|
||||
};
|
||||
}
|
||||
|
||||
/// Assert that a type has `Copy`
|
||||
#[macro_export]
|
||||
macro_rules! assert_copyable {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue