[llvm] [XCOFF][obj2yaml] support parsing auxiliary symbols for XCOFF (PR #70642)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 21:51:16 PST 2023


================
@@ -106,6 +111,79 @@ Error XCOFFDumper::dumpSections(ArrayRef<Shdr> Sections) {
   return Error::success();
 }
 
+static void
+dumpFileAuxSym(std::vector<std::unique_ptr<XCOFFYAML::AuxSymbolEnt>> &AuxEntTbl,
+               XCOFF::CFileStringType Type, StringRef FileStr) {
+  XCOFFYAML::FileAuxEnt FileAuxSym;
+  FileAuxSym.FileNameOrString = FileStr;
+  FileAuxSym.FileStringType = Type;
+  AuxEntTbl.push_back(std::make_unique<XCOFFYAML::FileAuxEnt>(FileAuxSym));
+}
+
+static void
+dumpStatAuxSym(std::vector<std::unique_ptr<XCOFFYAML::AuxSymbolEnt>> &AuxEntTbl,
+               const object::XCOFFSectAuxEntForStat &AuxEntPtr) {
+  XCOFFYAML::SectAuxEntForStat StatAuxSym;
+  StatAuxSym.SectionLength = AuxEntPtr.SectionLength;
+  StatAuxSym.NumberOfLineNum = AuxEntPtr.NumberOfLineNum;
+  StatAuxSym.NumberOfRelocEnt = AuxEntPtr.NumberOfRelocEnt;
+  AuxEntTbl.push_back(
----------------
EsmeYi wrote:

Thank you @diggerlin @jh7370 , well then I would prefer to keep current style.

https://github.com/llvm/llvm-project/pull/70642


More information about the llvm-commits mailing list