[PATCH] D84095: [DebugInfo] Make DIEDelta::SizeOf() more explicit. NFCI.

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 01:05:22 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG414b9bec6deb: [DebugInfo] Make DIEDelta::SizeOf() more explicit. NFCI. (authored by ikudrin).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84095

Files:
  llvm/lib/CodeGen/AsmPrinter/DIE.cpp


Index: llvm/lib/CodeGen/AsmPrinter/DIE.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DIE.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DIE.cpp
@@ -549,10 +549,15 @@
 /// SizeOf - Determine size of delta value in bytes.
 ///
 unsigned DIEDelta::SizeOf(const AsmPrinter *AP, dwarf::Form Form) const {
-  if (Form == dwarf::DW_FORM_data4) return 4;
-  if (Form == dwarf::DW_FORM_sec_offset) return 4;
-  if (Form == dwarf::DW_FORM_strp) return 4;
-  return AP->MAI->getCodePointerSize();
+  switch (Form) {
+  case dwarf::DW_FORM_data4:
+    return 4;
+  case dwarf::DW_FORM_sec_offset:
+    // FIXME: add support for DWARF64
+    return 4;
+  default:
+    llvm_unreachable("DIE Value form not supported yet");
+  }
 }
 
 LLVM_DUMP_METHOD


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84095.282521.patch
Type: text/x-patch
Size: 785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200803/a40d2e55/attachment.bin>


More information about the llvm-commits mailing list