aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2020-03-19 19:53:51 -0700
committerWouter van Oortmerssen <aardappel@gmail.com>2020-04-16 16:32:17 -0700
commit48139ebc3a1adee2efa0e6a72d6058e8e3712059 (patch)
tree3d4e4f757515ef2a0fdb6fb7aa8a7d93b93fe027 /llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
parent798b262c3c9d4a8603dc6c6bbbe0a7ffb82eadbc (diff)
downloadllvm-48139ebc3a1adee2efa0e6a72d6058e8e3712059.zip
llvm-48139ebc3a1adee2efa0e6a72d6058e8e3712059.tar.gz
llvm-48139ebc3a1adee2efa0e6a72d6058e8e3712059.tar.bz2
[WebAssembly] Add int32 DW_OP_WASM_location variant
This to allow us to add reloctable global indices as a symbol. Also adds R_WASM_GLOBAL_INDEX_I32 relocation type to support it. See discussion in https://github.com/WebAssembly/debugging/issues/12
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
index 036c2ae..30647fd 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
@@ -266,12 +266,11 @@ WebAssemblyFrameLowering::getDwarfFrameBase(const MachineFunction &MF) const {
const WebAssemblyFunctionInfo &MFI = *MF.getInfo<WebAssemblyFunctionInfo>();
if (needsSP(MF) && MFI.isFrameBaseVirtual()) {
unsigned LocalNum = MFI.getFrameBaseLocal();
- Loc.Location.WasmLoc = {WebAssembly::TI_LOCAL_START, LocalNum};
+ Loc.Location.WasmLoc = {WebAssembly::TI_LOCAL, LocalNum};
} else {
// TODO: This should work on a breakpoint at a function with no frame,
// but probably won't work for traversing up the stack.
- // TODO: This needs a relocation for correct __stack_pointer
- Loc.Location.WasmLoc = {WebAssembly::TI_GLOBAL_START, 0};
+ Loc.Location.WasmLoc = {WebAssembly::TI_GLOBAL_RELOC, 0};
}
return Loc;
}