[llvm] [XCOFF][obj2yaml] support parsing auxiliary symbols for XCOFF (PR #70642)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 31 01:10:08 PDT 2023
================
@@ -131,7 +200,121 @@ Error XCOFFDumper::dumpSymbols() {
Sym.Type = SymbolEntRef.getSymbolType();
Sym.StorageClass = SymbolEntRef.getStorageClass();
- Sym.NumberOfAuxEntries = SymbolEntRef.getNumberOfAuxEntries();
+ uint8_t NumOfAuxSym = SymbolEntRef.getNumberOfAuxEntries();
+ Sym.NumberOfAuxEntries = NumOfAuxSym;
+
+ if (NumOfAuxSym) {
+ auto AuxEntTbl = &Sym.AuxEntries;
+ switch (Sym.StorageClass) {
+ case XCOFF::C_FILE: {
+ for (int I = 1; I <= NumOfAuxSym; I++) {
----------------
jh7370 wrote:
1) `NumOfAuxSym` is a `uint8_t`, so `I` should be too.
2) `++I` (https://llvm.org/docs/CodingStandards.html#prefer-preincrement)
Also, this bit of code is pretty substantial. Let's pull this case body into a separate function for ease of following the `switch`.
https://github.com/llvm/llvm-project/pull/70642
More information about the llvm-commits
mailing list