[PATCH] D97184: [XCOFF] support DWARF for XCOFF for object output

Jinsong Ji via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 30 09:27:13 PDT 2021


jsji added inline comments.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:499
+    // If Sym is a DWARF section, return label's offset from the DWARF section.
+    return (ContainingSect->isDwarfSect()
+                ? 0
----------------
This is now a complicated expression, maybe using plain `if` else will make it clear without comment.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:1040
+  for (auto &DwarfSection : DwarfSections) {
+    if (SectionIndex > MaxSectionIndex)
+      report_fatal_error("Section index overflow!");
----------------
Do we need this? Or an assert?


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:1099
+    RawPointer = alignTo(RawPointer, DefaultSectionAlign);
+    if (RawPointer > UINT32_MAX)
+      report_fatal_error("Section raw data overflowed this object file.");
----------------
Assert?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97184



More information about the llvm-commits mailing list