[PATCH] D75131: [XCOFF][AIX] Enable -r option for llvm-objdump

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 15:40:19 PDT 2020


jasonliu marked 4 inline comments as done.
jasonliu added inline comments.


================
Comment at: llvm/lib/Object/XCOFFObjectFile.cpp:369
+  const uint32_t Index = Reloc->SymbolIndex;
+  assert(Index < getLogicalNumberOfSymbolTableEntries32() && "Symbol index is out of bounds.");
+
----------------
jhenderson wrote:
> clang-format. But should this really be an assertion rather than an llvm::Error or similar?
Ideally, we should return llvm::Expect<symbol_iterator> for this function. But if we do that, it would be a very big interface change across the board. We need to return llvm::Expect<symbol_iterator> for RelocationRef's getSymbol() as well, and there are several dozens of places used RelocationRef's getSymbol() method.

For other object files, they would return symbol_end(), and I think it would make more sense to follow suit in this case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75131/new/

https://reviews.llvm.org/D75131





More information about the llvm-commits mailing list