[llvm] [XCOFF][obj2yaml] support parsing auxiliary symbols for XCOFF (PR #70642)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 7 00:32:47 PST 2023
================
@@ -112,50 +112,59 @@ Error XCOFFDumper::dumpSections(ArrayRef<Shdr> Sections) {
}
static void
-dumpStatAuxSym(std::vector<std::unique_ptr<XCOFFYAML::AuxSymbolEnt>> *AuxEntTbl,
- const object::XCOFFSectAuxEntForStat *AuxEntPtr) {
+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(
+ StatAuxSym.SectionLength = AuxEntPtr.SectionLength;
+ StatAuxSym.NumberOfLineNum = AuxEntPtr.NumberOfLineNum;
+ StatAuxSym.NumberOfRelocEnt = AuxEntPtr.NumberOfRelocEnt;
+ AuxEntTbl.push_back(
std::make_unique<XCOFFYAML::SectAuxEntForStat>(StatAuxSym));
}
static void
-dumpFunAuxSym(std::vector<std::unique_ptr<XCOFFYAML::AuxSymbolEnt>> *AuxEntTbl,
- const object::XCOFFFunctionAuxEnt32 *AuxEntPtr) {
+dumpFunAuxSym(std::vector<std::unique_ptr<XCOFFYAML::AuxSymbolEnt>> &AuxEntTbl,
----------------
jh7370 wrote:
`dumpFuncAuxSym` would be clearer, I think? I'd rename the variables and other similar functions similarly.
https://github.com/llvm/llvm-project/pull/70642
More information about the llvm-commits
mailing list