@@ -183,7 +183,7 @@ struct LegalizeJSInterface : public Pass {
183183 std::map<Name, Name> illegalImportsToLegal;
184184
185185 template <typename T> bool isIllegal (T* t) {
186- for (auto param : t->sig .params . expand () ) {
186+ for (auto & param : t->sig .params ) {
187187 if (param == Type::i64 ) {
188188 return true ;
189189 }
@@ -222,9 +222,8 @@ struct LegalizeJSInterface : public Pass {
222222 call->target = func->name ;
223223 call->type = func->sig .results ;
224224
225- const std::vector<Type>& params = func->sig .params .expand ();
226225 std::vector<Type> legalParams;
227- for (auto param : params) {
226+ for (auto & param : func-> sig . params ) {
228227 if (param == Type::i64 ) {
229228 call->operands .push_back (I64Utilities::recreateI64 (
230229 builder, legalParams.size (), legalParams.size () + 1 ));
@@ -277,18 +276,19 @@ struct LegalizeJSInterface : public Pass {
277276 auto * call = module ->allocator .alloc <Call>();
278277 call->target = legalIm->name ;
279278
280- const std::vector<Type>& imParams = im->sig .params .expand ();
281279 std::vector<Type> params;
282- for (size_t i = 0 ; i < imParams.size (); ++i) {
283- if (imParams[i] == Type::i64 ) {
280+ Index i = 0 ;
281+ for (auto & param : im->sig .params ) {
282+ if (param == Type::i64 ) {
284283 call->operands .push_back (I64Utilities::getI64Low (builder, i));
285284 call->operands .push_back (I64Utilities::getI64High (builder, i));
286285 params.push_back (Type::i32 );
287286 params.push_back (Type::i32 );
288287 } else {
289- call->operands .push_back (builder.makeLocalGet (i, imParams[i] ));
290- params.push_back (imParams[i] );
288+ call->operands .push_back (builder.makeLocalGet (i, param ));
289+ params.push_back (param );
291290 }
291+ ++i;
292292 }
293293
294294 if (im->sig .results == Type::i64 ) {
0 commit comments