[llvm] [XCOFF][OBJECT] get symbol size by calling XCOFF interfaces (PR #67304)

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 00:56:39 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)
----------------
chenzheng1030 wrote:

> I do not think you need to define a new class xcoff_symbol_iterator ,

To me, adding a iterator range seems natural when there are already `symbol_begin` and `symbol_end` inside a class? (Maybe we can change `symbol_begin` and `symbol_end` with the new `xcoff_symbol_iterator` class). What do you think?

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


More information about the llvm-commits mailing list