summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-emscripten.cpp
diff options
context:
space:
mode:
authorDaniel Wirtz <dcode@dcode.io>2020-08-20 21:35:14 +0200
committerGitHub <noreply@github.com>2020-08-20 12:35:14 -0700
commitaf87f23744477b034dcb1c59af2a1a208becab23 (patch)
tree1f99d29f17191ecdd121cd15e455cea90b38d303 /src/wasm/wasm-emscripten.cpp
parenta18d30fb42838f2e4002338d6e57a25322f9e422 (diff)
downloadbinaryen-af87f23744477b034dcb1c59af2a1a208becab23.tar.gz
binaryen-af87f23744477b034dcb1c59af2a1a208becab23.tar.bz2
binaryen-af87f23744477b034dcb1c59af2a1a208becab23.zip
Use const modifier when dealing with types (#3064)
Since they make the code clearer and more self-documenting.
Diffstat (limited to 'src/wasm/wasm-emscripten.cpp')
-rw-r--r--src/wasm/wasm-emscripten.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp
index 48cf4b6f1..4a1a532dd 100644
--- a/src/wasm/wasm-emscripten.cpp
+++ b/src/wasm/wasm-emscripten.cpp
@@ -154,14 +154,14 @@ void EmscriptenGlueGenerator::generateDynCallThunk(Signature sig) {
std::vector<NameType> params;
params.emplace_back("fptr", Type::i32); // function pointer param
int p = 0;
- for (auto& param : sig.params) {
+ for (const auto& param : sig.params) {
params.emplace_back(std::to_string(p++), param);
}
Function* f = builder.makeFunction(name, std::move(params), sig.results, {});
Expression* fptr = builder.makeLocalGet(0, Type::i32);
std::vector<Expression*> args;
Index i = 0;
- for (auto& param : sig.params) {
+ for (const auto& param : sig.params) {
args.push_back(builder.makeLocalGet(++i, param));
}
Expression* call = builder.makeCallIndirect(fptr, args, sig);