diff options
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/Inlining.cpp | 4 | ||||
-rw-r--r-- | src/passes/call-utils.h | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/passes/Inlining.cpp b/src/passes/Inlining.cpp index 04bc6d78a..9e0d3eb67 100644 --- a/src/passes/Inlining.cpp +++ b/src/passes/Inlining.cpp @@ -31,7 +31,7 @@ #include <atomic> #include "ir/branch-utils.h" -#include "ir/debug.h" +#include "ir/debuginfo.h" #include "ir/drop.h" #include "ir/eh-utils.h" #include "ir/element-utils.h" @@ -579,7 +579,7 @@ static Expression* doInlining(Module* module, // Generate and update the inlined contents auto* contents = ExpressionManipulator::copy(from->body, *module); - debug::copyDebugInfo(from->body, contents, from, into); + debuginfo::copyBetweenFunctions(from->body, contents, from, into); updater.walk(contents); block->list.push_back(contents); block->type = retType; diff --git a/src/passes/call-utils.h b/src/passes/call-utils.h index 7f2ebfda3..10106a756 100644 --- a/src/passes/call-utils.h +++ b/src/passes/call-utils.h @@ -19,6 +19,7 @@ #include <variant> +#include "ir/debuginfo.h" #include "ir/type-updating.h" #include "wasm.h" @@ -130,14 +131,17 @@ convertToDirectCalls(T* curr, }; auto makeCall = [&](IndirectCallInfo info) -> Expression* { + Expression* ret; if (std::get_if<Trap>(&info)) { - return builder.makeUnreachable(); + ret = builder.makeUnreachable(); } else { - return builder.makeCall(std::get<Known>(info).target, - getOperands(), - curr->type, - curr->isReturn); + ret = builder.makeCall(std::get<Known>(info).target, + getOperands(), + curr->type, + curr->isReturn); } + debuginfo::copyOriginalToReplacement(curr, ret, &func); + return ret; }; auto* ifTrueCall = makeCall(ifTrueCallInfo); auto* ifFalseCall = makeCall(ifFalseCallInfo); |