[PATCH] D120858: [NFC][XCOFF] Refactor and format XCOFFObjectWriter.cpp.

Digger Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 4 12:51:40 PST 2022


DiggerLin added inline comments.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:817
   // FIXME: add the real source filename.
-  writeSymbolName(".file");
-  // n_value. The n_value of a C_FILE symbol is its symbol table index.
-  W.write<uint32_t>(0);
-  // n_scnum. N_DEBUG is a reserved section number for indicating a special
-  // symbolic debugging symbol.
-  W.write<int16_t>(XCOFF::ReservedSectionNum::N_DEBUG);
-  // n_type. The n_type field of a C_FILE symbol encodes the source language and
-  // CPU version info; zero indicates no info.
-  W.write<uint16_t>(0);
-  // n_sclass. The C_FILE symbol provides source file-name information,
-  // source-language ID and CPU-version ID information and some other optional
-  // infos.
-  W.write<uint8_t>(XCOFF::C_FILE);
-  // n_numaux. No aux entry for now.
-  W.write<uint8_t>(0);
+  writeSymbolBody(StringRef(".file"), 0, XCOFF::ReservedSectionNum::N_DEBUG, 0,
+                  XCOFF::C_FILE, 0);
----------------
we can use ".file" directly instead of StringRef(".file")


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120858



More information about the llvm-commits mailing list