[PATCH] D56587: Fix sign/zero extension in Dwarf expressions.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 7 13:37:53 PST 2019


aprantl added inline comments.


================
Comment at: docs/LangRef.rst:4670
+  expression stack is to be converted. Maps into a ``DW_OP_convert`` operation
+  that references a base type constructed from the supplied values.
 - ``DW_OP_swap`` swaps top two stack entries.
----------------
Thanks, this looks good!


================
Comment at: lib/AsmParser/LLParser.cpp:4837
+        return TokError(Twine("invalid DWARF attribute encoding '") + Lex.getStrVal() + "'");
+      }
+
----------------
Can you also add a round-trip test to  `test/Assembler/diexpression.ll`?


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:946
 
+  for (const auto &P : CUMap) {
+    auto &CU = *P.second;
----------------
markus wrote:
> If there were multiple Dwarf CUs in the same LLVM Module this would not work right. We need to emit base types for each DwarfCompileUnit but only those types that are used by DwarfExpressions in that unit. So appears to make sense to put the `MarkusNodes` inside the CU.
Would creating a separate CU just for our basic types help in any way?


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

https://reviews.llvm.org/D56587





More information about the llvm-commits mailing list