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

Markus Lavin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 7 06:33:15 PST 2019


markus marked 4 inline comments as done.
markus added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:946
 
+  for (const auto &P : CUMap) {
+    auto &CU = *P.second;
----------------
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.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2248
 
-      emitDebugLocEntryLocation(Entry);
+      emitDebugLocEntryLocation(Entry, nullptr /* TODO:FIXME: What label to use for DWO? */);
     }
----------------
For DWO how do we find the label into the corresponding `.debug_info` and how do we emit the base types? Would the code in DwarfDebug.cpp:946 work? I guess that I need to create some test cases for DWO.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfExpression.cpp:31
+//placed inside the DwarfCompileUnit class.
+std::vector<BaseTypeRef> MarkusNodes;
+
----------------
I think that we need one of these per DwarfCompileUnit.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfExpression.cpp:400
+      emitUnsigned(MarkusNodes.size());
+      MarkusNodes.emplace_back(Op->getArg(0) / 8,
+                               static_cast<dwarf::TypeKind>(Op->getArg(1)));
----------------
A `DwarfExpression` should always know which CU it belongs to right?


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

https://reviews.llvm.org/D56587





More information about the llvm-commits mailing list