[PATCH] D91867: [llvm-readobj] - Stop using `unwrapOrError` in `DumpStyle<ELFT>::getGroups()`

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 01:31:10 PST 2020

jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.


Comment at: llvm/test/tools/llvm-readobj/ELF/groups.test:186
+## In the first case we link the group section to the section with index 255, which does not exist.
+## We check that the warning is reported when we are unable to locate the symbol table.
+## In the second case we link the SHT_GROUP section to itself. This documents that we don't check the
jhenderson wrote:
Ping this?

Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3572
+template <class ELFT>
+static StringRef getSectionNameForError(const ELFFile<ELFT> &Obj,
+                                        const typename ELFT::Shdr &Sec,
grimar wrote:
> jhenderson wrote:
> > I don't like this function name. It implies it is solely for use by errors, which isn't the case. How about `getSectionNameOrFallback`?
> Done. 2 more possible names probably are: `getSectionNameOrWarn` or `tryGetSectionName`.
`tryGetSectionName` would work for me too. I'm happy with whichever you prefer. I'd probably not use `getSectionNameOrWarn`.



More information about the llvm-commits mailing list