[llvm] [XCOFF][OBJECT] get symbol size by calling XCOFF interfaces (PR #67304)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 27 07:48:30 PDT 2023
================
@@ -59,6 +59,13 @@ llvm::object::computeSymbolSizes(const ObjectFile &O) {
return Ret;
}
+ if (const auto *E = dyn_cast<XCOFFObjectFile>(&O)) {
+ auto Syms = E->symbols();
+ for (XCOFFSymbolRef Sym : Syms)
----------------
diggerlin wrote:
since in class ObjectFile , we already have
```
using symbol_iterator_range = iterator_range<symbol_iterator>;
symbol_iterator_range symbols() const {
return symbol_iterator_range(symbol_begin(), symbol_end());
}
```
I do not think you need to define a new class xcoff_symbol_iterator ,
we can change
change
` for (XCOFFSymbolRef Sym : Syms) `
--->
` for (SymbolRef Sym : Syms) `
and cast SymbolRef to XCOFFSymbolRef here.
https://github.com/llvm/llvm-project/pull/67304
More information about the llvm-commits
mailing list