[PATCH] D152945: [SystemZ][z/OS] Implement executePostLayoutBinding for GOFFWriter

Kevin P. Neal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 07:53:50 PDT 2023


kpn added inline comments.


================
Comment at: llvm/lib/MC/GOFFObjectWriter.cpp:937
+          Data.append(1, B);
+          I++;
+          if (I == MaxChunkSize) {
----------------
DiggerLin wrote:
> change to ++I;
Is this a documented standard? Because pre- and post- are widely used in the codebase.


================
Comment at: llvm/lib/MC/GOFFObjectWriter.cpp:1054
+  for (const auto &Sec : Sections)
+    writeText(*Sec, Asm, Layout);
   writeEnd();
----------------
DiggerLin wrote:
>  the GOFF has text section and data section ? if has , change the name to write writeSection ?
GOFF, and the mainframe in general, uses words differently from the Unix world. Sometimes it's the same word, and sometimes different words are used for similar concepts.

GOFF sections are SD symbols that have ED symbols as children. Text is owned by either an ED or PR symbol. Multiple blobs of text (TXT records) can exist in the same SD, probably owned by different symbols under that SD. Which means that "writing a section" doesn't mean what it means on other targets.

I'd say "writeText()" is the best name for this function. I admit it's a bit of a trick moving back and forth from the part of the LLVM codebase that comes from the Unix world to the GOFF codebase from the mainframe world. But inside a class named GOFFObjectWriter I'd suggest sticking with GOFF naming and conventions whenever possible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152945



More information about the llvm-commits mailing list