[PATCH] D52634: [WebAssembly] Use TargetIndex operands in DbgValue to track WebAssembly operands locations

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 11:16:38 PST 2019


dschuff added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp:580
+  // TODO This is a target-independent but the WebAssembly-specific expression
+  // is encoded here. Is there a better way?
+  emitOp(dwarf::DW_OP_WASM_location);
----------------
dschuff wrote:
> aprantl wrote:
> > It's also odd to generalize something for which only a single implementation exists...
> I think this is called what it is because TargetIndex is already a general operand type. But maybe at the DWARF layer it really just just be something like `DwarfExpression::addWasmLocation`, and then in asmPrinter/DwarfDebug.cpp we just call `addWasmLocation` instead. If it's possible to assert there that the target is wasm, so much the better.
The downside to that would be that if and when there are other places we want to use a `TargetIndex` instead of a `Register` (e.g. for the frame base) then we'd have to do that check in those places too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D52634/new/

https://reviews.llvm.org/D52634





More information about the llvm-commits mailing list