summaryrefslogtreecommitdiff
path: root/src/asm2wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-01-19 15:26:48 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-01-19 15:26:48 -0800
commit22ed7f49494e6ecf6c431b40ab6961953c2e3a8b (patch)
tree3dcdcf45d2ec47a86073d9d946e7e3e319cbe695 /src/asm2wasm.h
parentd3390ed43dbfb4834273b4296521f95b4d448654 (diff)
parent1021013aa7efdd6d071a8b053f87de846a6d30bd (diff)
downloadbinaryen-22ed7f49494e6ecf6c431b40ab6961953c2e3a8b.tar.gz
binaryen-22ed7f49494e6ecf6c431b40ab6961953c2e3a8b.tar.bz2
binaryen-22ed7f49494e6ecf6c431b40ab6961953c2e3a8b.zip
Merge pull request #103 from mbebenita/static-poly
Use LLVM style static polymorphism for AST Visitors
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r--src/asm2wasm.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index 75862abc8..7fa252c8c 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -1489,8 +1489,8 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
void Asm2WasmBuilder::optimize() {
// Optimization passes. Note: no effort is made to free nodes that are no longer held on to.
- struct BlockBreakOptimizer : public WasmWalker {
- void visitBlock(Block *curr) override {
+ struct BlockBreakOptimizer : public WasmWalker<BlockBreakOptimizer> {
+ void visitBlock(Block *curr) {
// if the block ends in a break on this very block, then just put the value there
Break *last = curr->list[curr->list.size()-1]->dyn_cast<Break>();
if (last && last->value && last->name == curr->name) {
@@ -1504,13 +1504,13 @@ void Asm2WasmBuilder::optimize() {
}
// we might be broken to, but maybe there isn't a break (and we may have removed it, leading to this)
- struct BreakSeeker : public WasmWalker {
+ struct BreakSeeker : public WasmWalker<BreakSeeker> {
IString target; // look for this one
size_t found;
BreakSeeker(IString target) : target(target), found(false) {}
- void visitBreak(Break *curr) override {
+ void visitBreak(Break *curr) {
if (curr->name == target) found++;
}
};