@@ -172,7 +172,7 @@ struct CloseBrace {};
172172
173173int GetShiftMask (Type type) {
174174 // clang-format off
175- switch (type) {
175+ switch (type. code () ) {
176176 case Type::I32: return 31 ;
177177 case Type::I64: return 63 ;
178178 default : WABT_UNREACHABLE; return 0 ;
@@ -641,7 +641,7 @@ void CWriter::PopLabel() {
641641// static
642642constexpr bool CWriter::AreInitializersAlwaysNull (Type type) {
643643 // clang-format off
644- switch (type) {
644+ switch (type. code () ) {
645645 case Type::FuncRef: return false ;
646646 case Type::ExternRef: return true ;
647647 case Type::ExnRef: return true ;
@@ -654,7 +654,7 @@ constexpr bool CWriter::AreInitializersAlwaysNull(Type type) {
654654// static
655655constexpr char CWriter::MangleType (Type type) {
656656 // clang-format off
657- switch (type) {
657+ switch (type. code () ) {
658658 case Type::I32: return ' i' ;
659659 case Type::I64: return ' j' ;
660660 case Type::F32: return ' f' ;
@@ -1227,7 +1227,7 @@ void CWriter::Write(const StackVar& sv) {
12271227// static
12281228const char * CWriter::GetCTypeName (const Type& type) {
12291229 // clang-format off
1230- switch (type) {
1230+ switch (type. code () ) {
12311231 case Type::I32: return " u32" ;
12321232 case Type::I64: return " u64" ;
12331233 case Type::F32: return " f32" ;
@@ -1248,7 +1248,7 @@ void CWriter::Write(Type type) {
12481248
12491249void CWriter::Write (TypeEnum type) {
12501250 // clang-format off
1251- switch (type.type ) {
1251+ switch (type.type . code () ) {
12521252 case Type::I32: Write (" WASM_RT_I32" ); break ;
12531253 case Type::I64: Write (" WASM_RT_I64" ); break ;
12541254 case Type::F32: Write (" WASM_RT_F32" ); break ;
@@ -1265,7 +1265,7 @@ void CWriter::Write(TypeEnum type) {
12651265
12661266void CWriter::Write (SignedType type) {
12671267 // clang-format off
1268- switch (type.type ) {
1268+ switch (type.type . code () ) {
12691269 case Type::I32: Write (" s32" ); break ;
12701270 case Type::I64: Write (" s64" ); break ;
12711271 default :
@@ -1285,7 +1285,7 @@ void CWriter::Write(const TypeVector& types) {
12851285}
12861286
12871287void CWriter::Write (const Const& const_) {
1288- switch (const_.type ()) {
1288+ switch (const_.type (). code () ) {
12891289 case Type::I32:
12901290 Writef (" %uu" , static_cast <int32_t >(const_.u32 ()));
12911291 break ;
@@ -3966,7 +3966,7 @@ void CWriter::Write(const ExprList& exprs) {
39663966 break ;
39673967
39683968 case ExprType::RefIsNull:
3969- switch (StackType (0 )) {
3969+ switch (StackType (0 ). code () ) {
39703970 case Type::FuncRef:
39713971 Write (StackVar (0 , Type::I32), " = (" , StackVar (0 ), " .func == NULL" ,
39723972 " );" , Newline ());
@@ -6113,7 +6113,7 @@ Result CWriter::WriteModule(const Module& module) {
61136113
61146114// static
61156115const char * CWriter::GetReferenceTypeName (const Type& type) {
6116- switch (type) {
6116+ switch (type. code () ) {
61176117 case Type::FuncRef:
61186118 return " funcref" ;
61196119 case Type::ExternRef:
@@ -6127,7 +6127,7 @@ const char* CWriter::GetReferenceTypeName(const Type& type) {
61276127
61286128// static
61296129const char * CWriter::GetReferenceNullValue (const Type& type) {
6130- switch (type) {
6130+ switch (type. code () ) {
61316131 case Type::FuncRef:
61326132 return " wasm_rt_funcref_null_value" ;
61336133 case Type::ExternRef:
0 commit comments