summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/execution-results.h2
-rw-r--r--src/tools/fuzzing.h14
-rw-r--r--src/tools/js-wrapper.h2
-rw-r--r--src/tools/spec-wrapper.h2
-rw-r--r--src/tools/wasm-shell.cpp2
-rw-r--r--src/tools/wasm2c-wrapper.h4
6 files changed, 13 insertions, 13 deletions
diff --git a/src/tools/execution-results.h b/src/tools/execution-results.h
index dc62bba38..38989aedf 100644
--- a/src/tools/execution-results.h
+++ b/src/tools/execution-results.h
@@ -144,7 +144,7 @@ struct ExecutionResults {
instance.callFunction(ex->value, arguments);
}
// call the method
- for (auto& param : func->sig.params) {
+ for (const auto& param : func->sig.params) {
// zeros in arguments TODO: more?
arguments.push_back(Literal::makeSingleZero(param));
}
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h
index c76b6e13a..23ea6bbec 100644
--- a/src/tools/fuzzing.h
+++ b/src/tools/fuzzing.h
@@ -308,7 +308,7 @@ private:
Type getSubType(Type type) {
if (type.isMulti()) {
std::vector<Type> types;
- for (auto& t : type) {
+ for (const auto& t : type) {
types.push_back(getSubType(t));
}
return Type(types);
@@ -770,7 +770,7 @@ private:
std::vector<Expression*> invocations;
while (oneIn(2) && !finishedInput) {
std::vector<Expression*> args;
- for (auto& type : func->sig.params) {
+ for (const auto& type : func->sig.params) {
args.push_back(makeConst(type));
}
Expression* invoke =
@@ -1166,7 +1166,7 @@ private:
}
// we found one!
std::vector<Expression*> args;
- for (auto& argType : target->sig.params) {
+ for (const auto& argType : target->sig.params) {
args.push_back(make(argType));
}
return builder.makeCall(target->name, args, type, isReturn);
@@ -1210,7 +1210,7 @@ private:
target = make(Type::i32);
}
std::vector<Expression*> args;
- for (auto& type : targetFn->sig.params) {
+ for (const auto& type : targetFn->sig.params) {
args.push_back(make(type));
}
return builder.makeCallIndirect(target, args, targetFn->sig, isReturn);
@@ -1267,7 +1267,7 @@ private:
assert(wasm.features.hasMultivalue());
assert(type.isMulti());
std::vector<Expression*> elements;
- for (auto& t : type) {
+ for (const auto& t : type) {
elements.push_back(make(t));
}
return builder.makeTupleMake(std::move(elements));
@@ -1281,7 +1281,7 @@ private:
// Find indices from which we can extract `type`
std::vector<size_t> extractIndices;
size_t i = 0;
- for (auto& t : tupleType) {
+ for (const auto& t : tupleType) {
if (t == type) {
extractIndices.push_back(i);
}
@@ -1767,7 +1767,7 @@ private:
}
if (type.isMulti()) {
std::vector<Expression*> operands;
- for (auto& t : type) {
+ for (const auto& t : type) {
operands.push_back(makeConst(t));
}
return builder.makeTupleMake(std::move(operands));
diff --git a/src/tools/js-wrapper.h b/src/tools/js-wrapper.h
index 58e52b782..cfbc36ee6 100644
--- a/src/tools/js-wrapper.h
+++ b/src/tools/js-wrapper.h
@@ -99,7 +99,7 @@ static std::string generateJSWrapper(Module& wasm) {
}
ret += std::string("instance.exports.") + exp->name.str + "(";
bool first = true;
- for (auto& param : func->sig.params) {
+ for (const auto& param : func->sig.params) {
// zeros in arguments TODO more?
if (first) {
first = false;
diff --git a/src/tools/spec-wrapper.h b/src/tools/spec-wrapper.h
index 513cc8bda..44f92b56d 100644
--- a/src/tools/spec-wrapper.h
+++ b/src/tools/spec-wrapper.h
@@ -30,7 +30,7 @@ static std::string generateSpecWrapper(Module& wasm) {
}
ret += std::string("(invoke \"hangLimitInitializer\") (invoke \"") +
exp->name.str + "\" ";
- for (auto& param : func->sig.params) {
+ for (const auto& param : func->sig.params) {
// zeros in arguments TODO more?
TODO_SINGLE_COMPOUND(param);
switch (param.getBasic()) {
diff --git a/src/tools/wasm-shell.cpp b/src/tools/wasm-shell.cpp
index 1093ff85c..688815598 100644
--- a/src/tools/wasm-shell.cpp
+++ b/src/tools/wasm-shell.cpp
@@ -111,7 +111,7 @@ static void run_asserts(Name moduleName,
std::cerr << "Unknown entry " << entry << std::endl;
} else {
LiteralList arguments;
- for (auto& param : function->sig.params) {
+ for (const auto& param : function->sig.params) {
arguments.push_back(Literal(param));
}
try {
diff --git a/src/tools/wasm2c-wrapper.h b/src/tools/wasm2c-wrapper.h
index 0dd3c4381..91971c68b 100644
--- a/src/tools/wasm2c-wrapper.h
+++ b/src/tools/wasm2c-wrapper.h
@@ -165,7 +165,7 @@ int main(int argc, char** argv) {
ret += wasm2cSignature(result);
if (func->sig.params.isMulti()) {
- for (auto& param : func->sig.params) {
+ for (const auto& param : func->sig.params) {
ret += wasm2cSignature(param);
}
} else {
@@ -175,7 +175,7 @@ int main(int argc, char** argv) {
// Emit the parameters (all 0s, like the other wrappers).
bool first = true;
- for (auto& param : func->sig.params) {
+ for (const auto& param : func->sig.params) {
WASM_UNUSED(param);
if (!first) {
ret += ", ";