summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-stack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-stack.cpp')
-rw-r--r--src/wasm/wasm-stack.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index f1413847f..99aaf517e 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -2779,6 +2779,9 @@ StackInst* StackIRGenerator::makeStackInst(StackInst::Op op,
}
void StackIRToBinaryWriter::write() {
+ if (func->prologLocation.size()) {
+ parent.writeDebugLocation(*func->prologLocation.begin());
+ }
writer.mapLocalsAndEmitHeader();
// Stack to track indices of catches within a try
SmallVector<Index, 4> catchIndexStack;
@@ -2795,7 +2798,13 @@ void StackIRToBinaryWriter::write() {
case StackInst::IfBegin:
case StackInst::LoopBegin:
case StackInst::TryTableBegin: {
+ if (sourceMap) {
+ parent.writeDebugLocation(inst->origin, func);
+ }
writer.visit(inst->origin);
+ if (sourceMap) {
+ parent.writeDebugLocationEnd(inst->origin, func);
+ }
break;
}
case StackInst::TryEnd:
@@ -2830,6 +2839,9 @@ void StackIRToBinaryWriter::write() {
WASM_UNREACHABLE("unexpected op");
}
}
+ if (func->epilogLocation.size()) {
+ parent.writeDebugLocation(*func->epilogLocation.begin());
+ }
writer.emitFunctionEnd();
}