| 665 | // >>>>>>>> Const expression to generate value from value type >>>>>>>>>>>>>>>>> |
| 666 | |
| 667 | inline ValVariant ValueFromType(ValType Type) noexcept { |
| 668 | switch (Type.getCode()) { |
| 669 | case TypeCode::I32: |
| 670 | return uint32_t(0U); |
| 671 | case TypeCode::I64: |
| 672 | return uint64_t(0U); |
| 673 | case TypeCode::F32: |
| 674 | return float(0.0F); |
| 675 | case TypeCode::F64: |
| 676 | return double(0.0); |
| 677 | case TypeCode::V128: |
| 678 | return uint128_t(0U); |
| 679 | case TypeCode::Ref: |
| 680 | case TypeCode::RefNull: |
| 681 | return RefVariant(Type); |
| 682 | default: |
| 683 | assumingUnreachable(); |
| 684 | } |
| 685 | } |
| 686 | |
| 687 | // <<<<<<<< Const expression to generate value from value type <<<<<<<<<<<<<<<<< |
| 688 |
no test coverage detected