File tree 10 files changed +27
-31
lines changed 10 files changed +27
-31
lines changed Original file line number Diff line number Diff line change @@ -2023,11 +2023,8 @@ struct PrintExpressionContents
2023
2023
void visitNop (Nop* curr) { printMinor (o, " nop" ); }
2024
2024
void visitUnreachable (Unreachable* curr) { printMinor (o, " unreachable" ); }
2025
2025
void visitPop (Pop* curr) {
2026
- prepareColor (o) << " pop" ;
2027
- for (auto type : curr->type ) {
2028
- o << ' ' ;
2029
- printType (type);
2030
- }
2026
+ prepareColor (o) << " pop " ;
2027
+ printType (curr->type );
2031
2028
restoreNormalColor (o);
2032
2029
}
2033
2030
void visitTupleMake (TupleMake* curr) {
Original file line number Diff line number Diff line change @@ -2394,11 +2394,10 @@ Expression* SExpressionWasmBuilder::makeMemoryFill(Element& s) {
2394
2394
2395
2395
Expression* SExpressionWasmBuilder::makePop (Element& s) {
2396
2396
auto ret = allocator.alloc <Pop>();
2397
- std::vector<Type> types;
2398
- for (size_t i = 1 ; i < s.size (); ++i) {
2399
- types.push_back (elementToType (*s[i]));
2397
+ if (s.size () != 2 ) {
2398
+ throw SParseException (" expected 'pop <valtype>'" , s);
2400
2399
}
2401
- ret->type = Type (types );
2400
+ ret->type = elementToType (*s[ 1 ] );
2402
2401
ret->finalize ();
2403
2402
return ret;
2404
2403
}
Original file line number Diff line number Diff line change @@ -2237,7 +2237,7 @@ BinaryenFeatureAll: 131071
2237
2237
(pop externref)
2238
2238
)
2239
2239
(tuple.drop 4
2240
- (pop i32 i64 f32 f64)
2240
+ (pop (tuple i32 i64 f32 f64) )
2241
2241
)
2242
2242
(drop
2243
2243
(memory.size)
Original file line number Diff line number Diff line change 115
115
;; CHECK-TEXT-NEXT: )
116
116
;; CHECK-TEXT-NEXT: (catch $e-i32-i64
117
117
;; CHECK-TEXT-NEXT: (local.set $x
118
- ;; CHECK-TEXT-NEXT: (pop i32 i64)
118
+ ;; CHECK-TEXT-NEXT: (pop (tuple i32 i64) )
119
119
;; CHECK-TEXT-NEXT: )
120
120
;; CHECK-TEXT-NEXT: (drop
121
121
;; CHECK-TEXT-NEXT: (tuple.extract 2 0
139
139
;; CHECK-BIN-NEXT: )
140
140
;; CHECK-BIN-NEXT: (catch $e-i32-i64
141
141
;; CHECK-BIN-NEXT: (local.set $2
142
- ;; CHECK-BIN-NEXT: (pop i32 i64)
142
+ ;; CHECK-BIN-NEXT: (pop (tuple i32 i64) )
143
143
;; CHECK-BIN-NEXT: )
144
144
;; CHECK-BIN-NEXT: (local.set $x
145
145
;; CHECK-BIN-NEXT: (block (result i32)
168
168
(throw $e-i32-i64 (i32.const 0 ) (i64.const 0 ))
169
169
)
170
170
(catch $e-i32-i64
171
- (local.set $x (pop i32 i64 ))
171
+ (local.set $x (pop (tuple i32 i64 ) ))
172
172
(drop
173
173
(tuple.extract 2 0
174
174
(local.get $x )
1387
1387
;; CHECK-BIN-NODEBUG-NEXT: )
1388
1388
;; CHECK-BIN-NODEBUG-NEXT: (catch $tag$2
1389
1389
;; CHECK-BIN-NODEBUG-NEXT: (local.set $2
1390
- ;; CHECK-BIN-NODEBUG-NEXT: (pop i32 i64)
1390
+ ;; CHECK-BIN-NODEBUG-NEXT: (pop (tuple i32 i64) )
1391
1391
;; CHECK-BIN-NODEBUG-NEXT: )
1392
1392
;; CHECK-BIN-NODEBUG-NEXT: (local.set $0
1393
1393
;; CHECK-BIN-NODEBUG-NEXT: (block (result i32)
Original file line number Diff line number Diff line change 334
334
;; CHECK-NEXT: )
335
335
;; CHECK-NEXT: (catch $e-i32-f32
336
336
;; CHECK-NEXT: (local.set $1
337
- ;; CHECK-NEXT: (pop i32 f32)
337
+ ;; CHECK-NEXT: (pop (tuple i32 f32) )
338
338
;; CHECK-NEXT: )
339
339
;; CHECK-NEXT: (throw $e-i32
340
340
;; CHECK-NEXT: (block (result i32)
354
354
(throw $e-i32
355
355
;; This tests a pop taking a tuple type.
356
356
(block (result i32 )
357
- (local.set $x (pop i32 f32 ))
357
+ (local.set $x (pop (tuple i32 f32 ) ))
358
358
(i32.const 0 )
359
359
)
360
360
)
Original file line number Diff line number Diff line change 2150
2150
;; CHECK-NEXT: )
2151
2151
;; CHECK-NEXT: (catch $tag
2152
2152
;; CHECK-NEXT: (local.set $0
2153
- ;; CHECK-NEXT: (pop anyref anyref)
2153
+ ;; CHECK-NEXT: (pop (tuple anyref anyref) )
2154
2154
;; CHECK-NEXT: )
2155
2155
;; CHECK-NEXT: (drop
2156
2156
;; CHECK-NEXT: (block (result nullref)
2169
2169
;; CHECK-NEXT: (catch $tag
2170
2170
;; CHECK-NEXT: (drop
2171
2171
;; CHECK-NEXT: (tuple.extract 2 1
2172
- ;; CHECK-NEXT: (pop anyref anyref)
2172
+ ;; CHECK-NEXT: (pop (tuple anyref anyref) )
2173
2173
;; CHECK-NEXT: )
2174
2174
;; CHECK-NEXT: )
2175
2175
;; CHECK-NEXT: )
2187
2187
(catch $tag
2188
2188
(drop
2189
2189
(tuple.extract 2 0
2190
- (pop (ref null any) (ref null any))
2190
+ (pop (tuple ( ref null any) (ref null any) ))
2191
2191
)
2192
2192
)
2193
2193
)
2198
2198
(catch $tag
2199
2199
(drop
2200
2200
(tuple.extract 2 1
2201
- (pop (ref null any) (ref null any))
2201
+ (pop (tuple ( ref null any) (ref null any) ))
2202
2202
)
2203
2203
)
2204
2204
)
Original file line number Diff line number Diff line change 482
482
;; CHECK-NEXT: (i32.const 0)
483
483
;; CHECK-NEXT: (i64.const 1)
484
484
;; CHECK-NEXT: (br $l
485
- ;; CHECK-NEXT: (pop i32 i64)
485
+ ;; CHECK-NEXT: (pop (tuple i32 i64) )
486
486
;; CHECK-NEXT: )
487
487
;; CHECK-NEXT: )
488
488
;; CHECK-NEXT: )
501
501
;; CHECK-NEXT: (i32.const 0)
502
502
;; CHECK-NEXT: (i64.const 1)
503
503
;; CHECK-NEXT: (return
504
- ;; CHECK-NEXT: (pop i32 i64)
504
+ ;; CHECK-NEXT: (pop (tuple i32 i64) )
505
505
;; CHECK-NEXT: )
506
506
;; CHECK-NEXT: )
507
507
(func $return-tuple (result i32 i64 )
Original file line number Diff line number Diff line change 232
232
)
233
233
(catch $e-i32-i64
234
234
(tuple.drop 2
235
- (pop i32 i64 )
235
+ (pop (tuple i32 i64 ) )
236
236
)
237
237
)
238
238
(catch_all
294
294
)
295
295
(catch $e-i32-i64
296
296
(tuple.drop 2
297
- (pop i32 i64 )
297
+ (pop (tuple i32 i64 ) )
298
298
)
299
299
(rethrow $l0 )
300
300
)
515
515
)
516
516
(catch $e-i32-i64
517
517
(tuple.drop 2
518
- (pop i32 i64 )
518
+ (pop (tuple i32 i64 ) )
519
519
)
520
520
(i32.const 1 )
521
521
)
584
584
)
585
585
(catch $e-i32-i64
586
586
(tuple.drop 2
587
- (pop i32 i64 )
587
+ (pop (tuple i32 i64 ) )
588
588
)
589
589
(rethrow $l0 )
590
590
)
856
856
)
857
857
)
858
858
(catch $e-i32-i64
859
- (pop i32 i64 )
859
+ (pop (tuple i32 i64 ) )
860
860
)
861
861
(catch_all
862
862
(tuple.make 2
932
932
)
933
933
(catch $e-i32-i64
934
934
(tuple.drop 2
935
- (pop i32 i64 )
935
+ (pop (tuple i32 i64 ) )
936
936
)
937
937
(rethrow $l0 )
938
938
)
1050
1050
)
1051
1051
(catch $e-i32-i64
1052
1052
(tuple.drop 2
1053
- (pop i32 i64 )
1053
+ (pop (tuple i32 i64 ) )
1054
1054
)
1055
1055
(rethrow $l0 )
1056
1056
)
Original file line number Diff line number Diff line change 1824
1824
;; CHECK-NEXT: )
1825
1825
;; CHECK-NEXT: )
1826
1826
;; CHECK-NEXT: (catch $tag-pair
1827
- ;; CHECK-NEXT: (pop i32 i64)
1827
+ ;; CHECK-NEXT: (pop (tuple i32 i64) )
1828
1828
;; CHECK-NEXT: )
1829
1829
;; CHECK-NEXT: )
1830
1830
;; CHECK-NEXT: )
Original file line number Diff line number Diff line change 82
82
)
83
83
(catch $e-i32-f32
84
84
(local.set $x
85
- (pop i32 f32 )
85
+ (pop (tuple i32 f32 ) )
86
86
)
87
87
(tuple.extract 2 0
88
88
(local.get $x )
You can’t perform that action at this time.
0 commit comments