summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-01-14 17:44:12 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-01-14 17:44:12 -0800
commit921c9d96698c9c515aa274eaeb42b8fd1c140abd (patch)
treebca0ccd92e7b9a05a39f42980f1638b87436ec54 /src/wasm-binary.h
parent3f61f46ef2e660ad8001d2dd93218c1e830188c8 (diff)
downloadbinaryen-921c9d96698c9c515aa274eaeb42b8fd1c140abd.tar.gz
binaryen-921c9d96698c9c515aa274eaeb42b8fd1c140abd.tar.bz2
binaryen-921c9d96698c9c515aa274eaeb42b8fd1c140abd.zip
improve for loops
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r--src/wasm-binary.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index 99a68cf12..6b2e960d4 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -350,7 +350,7 @@ class WasmBinaryWriter : public WasmVisitor<void> {
void prepare() {
// we need function types for all our functions
- for (auto func : wasm->functions) {
+ for (auto* func : wasm->functions) {
func->type = ensureFunctionType(getSig(func), wasm, allocator)->name;
}
}
@@ -382,7 +382,7 @@ public:
void writeSignatures() {
if (debug) std::cerr << "== writeSignatures" << std::endl;
o << int8_t(BinaryConsts::Signatures) << LEB128(wasm->functionTypes.size());
- for (auto type : wasm->functionTypes) {
+ for (auto* type : wasm->functionTypes) {
if (debug) std::cerr << "write one" << std::endl;
o << int8_t(type->params.size());
o << binaryWasmType(type->result);
@@ -568,7 +568,7 @@ public:
o << int8_t(BinaryConsts::Block) << int8_t(curr->list.size());
breakStack.push_back(curr->name);
size_t i = 0;
- for (auto& child : curr->list) {
+ for (auto* child : curr->list) {
if (debug) std::cerr << " " << size_t(curr) << "\n zz Block element " << i++ << std::endl;
recurse(child);
}
@@ -621,7 +621,7 @@ public:
}
breakStack.push_back(curr->name);
recurse(curr->value);
- for (auto c : curr->cases) {
+ for (auto& c : curr->cases) {
recurse(c.body);
}
breakStack.pop_back();
@@ -629,14 +629,14 @@ public:
void visitCall(Call *curr) {
if (debug) std::cerr << "zz node: Call" << std::endl;
o << int8_t(BinaryConsts::CallFunction) << LEB128(getFunctionIndex(curr->target));
- for (auto operand : curr->operands) {
+ for (auto* operand : curr->operands) {
recurse(operand);
}
}
void visitCallImport(CallImport *curr) {
if (debug) std::cerr << "zz node: CallImport" << std::endl;
o << int8_t(BinaryConsts::CallFunction) << LEB128(getFunctionIndex(curr->target));
- for (auto operand : curr->operands) {
+ for (auto* operand : curr->operands) {
recurse(operand);
}
}
@@ -644,7 +644,7 @@ public:
if (debug) std::cerr << "zz node: CallIndirect" << std::endl;
o << int8_t(BinaryConsts::CallIndirect) << LEB128(getFunctionTypeIndex(curr->fullType->name));
recurse(curr->target);
- for (auto operand : curr->operands) {
+ for (auto* operand : curr->operands) {
recurse(operand);
}
}