summaryrefslogtreecommitdiff
path: root/src/ir
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir')
-rw-r--r--src/ir/ExpressionAnalyzer.cpp4
-rw-r--r--src/ir/utils.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/ir/ExpressionAnalyzer.cpp b/src/ir/ExpressionAnalyzer.cpp
index e2345d303..28c59491a 100644
--- a/src/ir/ExpressionAnalyzer.cpp
+++ b/src/ir/ExpressionAnalyzer.cpp
@@ -24,7 +24,7 @@ namespace wasm {
// Given a stack of expressions, checks if the topmost is used as a result.
// For example, if the parent is a block and the node is before the last position,
// it is not used.
-bool ExpressionAnalyzer::isResultUsed(std::vector<Expression*> stack, Function* func) {
+bool ExpressionAnalyzer::isResultUsed(ExpressionStack& stack, Function* func) {
for (int i = int(stack.size()) - 2; i >= 0; i--) {
auto* curr = stack[i];
auto* above = stack[i + 1];
@@ -52,7 +52,7 @@ bool ExpressionAnalyzer::isResultUsed(std::vector<Expression*> stack, Function*
}
// Checks if a value is dropped.
-bool ExpressionAnalyzer::isResultDropped(std::vector<Expression*> stack) {
+bool ExpressionAnalyzer::isResultDropped(ExpressionStack& stack) {
for (int i = int(stack.size()) - 2; i >= 0; i--) {
auto* curr = stack[i];
auto* above = stack[i + 1];
diff --git a/src/ir/utils.h b/src/ir/utils.h
index 85c485552..db437875d 100644
--- a/src/ir/utils.h
+++ b/src/ir/utils.h
@@ -45,10 +45,10 @@ struct ExpressionAnalyzer {
// Given a stack of expressions, checks if the topmost is used as a result.
// For example, if the parent is a block and the node is before the last position,
// it is not used.
- static bool isResultUsed(std::vector<Expression*> stack, Function* func);
+ static bool isResultUsed(ExpressionStack& stack, Function* func);
// Checks if a value is dropped.
- static bool isResultDropped(std::vector<Expression*> stack);
+ static bool isResultDropped(ExpressionStack& stack);
// Checks if a break is a simple - no condition, no value, just a plain branching
static bool isSimple(Break* curr) {
@@ -212,7 +212,7 @@ struct ReFinalizeNode : public OverriddenVisitor<ReFinalizeNode> {
void visitModule(Module* curr) { WASM_UNREACHABLE(); }
// given a stack of nested expressions, update them all from child to parent
- static void updateStack(std::vector<Expression*>& expressionStack) {
+ static void updateStack(ExpressionStack& expressionStack) {
for (int i = int(expressionStack.size()) - 1; i >= 0; i--) {
auto* curr = expressionStack[i];
ReFinalizeNode().visit(curr);