diff options
author | Michael Bebenita <mbebenita@gmail.com> | 2016-01-13 20:13:04 -0800 |
---|---|---|
committer | Michael Bebenita <mbebenita@gmail.com> | 2016-01-13 20:13:04 -0800 |
commit | e165020f87f807179d27203195843c88fb8afe55 (patch) | |
tree | 6b8f19534b32e8a8de32e6d380f5a537a6965368 /src/asm2wasm.h | |
parent | 7e3bdd00f9b390c36461291fa5b884ace55e82d6 (diff) | |
download | binaryen-e165020f87f807179d27203195843c88fb8afe55.tar.gz binaryen-e165020f87f807179d27203195843c88fb8afe55.tar.bz2 binaryen-e165020f87f807179d27203195843c88fb8afe55.zip |
Use LLVM style static polymorphism for WasmVisitors.
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r-- | src/asm2wasm.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 75862abc8..b968b8596 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> { + 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, void> { 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++; } }; |