diff options
-rw-r--r-- | src/passes/Precompute.cpp | 2 | ||||
-rw-r--r-- | src/wasm-interpreter.h | 33 | ||||
-rw-r--r-- | src/wasm-printing.h | 4 |
3 files changed, 22 insertions, 17 deletions
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp index dd390150e..7d3e691e1 100644 --- a/src/passes/Precompute.cpp +++ b/src/passes/Precompute.cpp @@ -79,7 +79,7 @@ public: if (iter != getValues.end()) { auto values = iter->second; if (values.isConcrete()) { - return Flow(std::move(values)); + return Flow(values); } } return ExpressionRunner<PrecomputingExpressionRunner>::visitLocalGet(curr); diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 6432eee79..393c33b75 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -1252,7 +1252,7 @@ public: // Check if a constant value has been set in the context of this runner. auto iter = localValues.find(curr->index); if (iter != localValues.end()) { - return Flow(std::move(iter->second)); + return Flow(iter->second); } return Flow(NONCONSTANT_FLOW); } @@ -1288,7 +1288,7 @@ public: // Check if a constant value has been set in the context of this runner. auto iter = globalValues.find(curr->name); if (iter != globalValues.end()) { - return Flow(std::move(iter->second)); + return Flow(iter->second); } return Flow(NONCONSTANT_FLOW); } @@ -1327,13 +1327,13 @@ public: auto argFlow = visit(curr->operands[i]); if (!argFlow.breaking()) { assert(argFlow.values.isConcrete()); - localValues[i] = std::move(argFlow.values); + localValues[i] = argFlow.values; } } auto retFlow = visit(func->body); - localValues = std::move(prevLocalValues); + localValues = prevLocalValues; if (retFlow.breakTo == RETURN_FLOW) { - return Flow(std::move(retFlow.values)); + return Flow(retFlow.values); } else if (!retFlow.breaking()) { return retFlow; } @@ -1343,7 +1343,7 @@ public: return Flow(NONCONSTANT_FLOW); } - Flow visitCallIndirect(CallIndirect*) { + Flow visitCallIndirect(CallIndirect* curr) { NOTE_ENTER("CallIndirect"); return Flow(NONCONSTANT_FLOW); } @@ -1375,39 +1375,39 @@ public: NOTE_ENTER("MemoryFill"); return Flow(NONCONSTANT_FLOW); } - Flow visitAtomicRMW(AtomicRMW*) { + Flow visitAtomicRMW(AtomicRMW* curr) { NOTE_ENTER("AtomicRMW"); return Flow(NONCONSTANT_FLOW); } - Flow visitAtomicCmpxchg(AtomicCmpxchg*) { + Flow visitAtomicCmpxchg(AtomicCmpxchg* curr) { NOTE_ENTER("AtomicCmpxchg"); return Flow(NONCONSTANT_FLOW); } - Flow visitAtomicWait(AtomicWait*) { + Flow visitAtomicWait(AtomicWait* curr) { NOTE_ENTER("AtomicWait"); return Flow(NONCONSTANT_FLOW); } - Flow visitAtomicNotify(AtomicNotify*) { + Flow visitAtomicNotify(AtomicNotify* curr) { NOTE_ENTER("AtomicNotify"); return Flow(NONCONSTANT_FLOW); } - Flow visitSIMDLoad(SIMDLoad*) { + Flow visitSIMDLoad(SIMDLoad* curr) { NOTE_ENTER("SIMDLoad"); return Flow(NONCONSTANT_FLOW); } - Flow visitSIMDLoadSplat(SIMDLoad*) { + Flow visitSIMDLoadSplat(SIMDLoad* curr) { NOTE_ENTER("SIMDLoadSplat"); return Flow(NONCONSTANT_FLOW); } - Flow visitSIMDLoadExtend(SIMDLoad*) { + Flow visitSIMDLoadExtend(SIMDLoad* curr) { NOTE_ENTER("SIMDLoadExtend"); return Flow(NONCONSTANT_FLOW); } - Flow visitPush(Push*) { + Flow visitPush(Push* curr) { NOTE_ENTER("Push"); return Flow(NONCONSTANT_FLOW); } - Flow visitPop(Pop*) { + Flow visitPop(Pop* curr) { NOTE_ENTER("Pop"); return Flow(NONCONSTANT_FLOW); } @@ -2470,7 +2470,8 @@ public: functionStack.pop_back(); } #ifdef WASM_INTERPRETER_DEBUG - std::cout << "exiting " << function->name << " with " << ret << '\n'; + std::cout << "exiting " << function->name << " with " << flow.values + << '\n'; #endif return flow.values; } diff --git a/src/wasm-printing.h b/src/wasm-printing.h index 712dd3c1f..276a387ae 100644 --- a/src/wasm-printing.h +++ b/src/wasm-printing.h @@ -53,6 +53,10 @@ inline std::ostream& operator<<(std::ostream& o, wasm::Expression& expression) { return wasm::WasmPrinter::printExpression(&expression, o); } +inline std::ostream& operator<<(std::ostream& o, wasm::Expression* expression) { + return wasm::WasmPrinter::printExpression(expression, o); +} + inline std::ostream& operator<<(std::ostream& o, wasm::StackInst& inst) { return wasm::WasmPrinter::printStackInst(&inst, o); } |