[PATCH] D36907: [codeview] support more DW_OPs for more complete debug info

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 14:35:08 PDT 2017


inglorion added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/VariableLocation.cpp:33-50
+    case dwarf::DW_OP_constu: {
+      int Value = Op->getArg(0);
+      ++Op;
+      if (Op != DIExpr->expr_op_end()) {
+        switch (Op->getOp()) {
+        case dwarf::DW_OP_minus:
+          Offset -= Value;
----------------
rnk wrote:
> I was thinking about how to improve DIExpression over the weekend, and one of the ideas I came up with is that we should "canonicalize" them on construction, and we should add a high-level opcode like DW_OP_LLVM_fragment that expresses DW_OP_deref plus a signed offset. That would eliminate the need for a ton of DW_OP_const/minus/plus parsing and centralize the logic in the DIExpression opcode canonicalization phase. CodeGen and mid-level passes would be able to reason about chains of loads with offsets, or they would give up if the expression is too complicated.
> 
> This is an idle thought for a future patch, though...
Yeah, I was thinking along similar lines: Have a DW_OP that represents what we commonly want, and keep the existing format for DIExpression so we don't have to change the representation and we can still express complex things. Like you said, that's for a future patch, though.


https://reviews.llvm.org/D36907





More information about the llvm-commits mailing list