[PATCH] D59060: Compute and Print Type and Section columns in "llvm-nm -f sysv" output. Round 2.
Sunil Srivastava via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 7 11:33:35 PST 2019
Sunil_Srivastava marked an inline comment as done.
Sunil_Srivastava added inline comments.
================
Comment at: tools/llvm-nm/llvm-nm.cpp:1113
+ if (!SecIOrErr) {
+ consumeError(SecIOrErr.takeError());
+ return '?';
----------------
Sunil_Srivastava wrote:
> Sunil_Srivastava wrote:
> > jhenderson wrote:
> > > Could you add a comment explaining why we throw away the error rather than reporting it here, please?
> > I have copied the usage from other places in the same file. I am assuming that consumeError is handling the error.
> consumeError() is calling handleAllErrors which handles errors.
I see now that `consumeError` is 'throwing away' errors in some sense.
This function, `getNMSectionTagAndName` is the rename of `getNMTypeChar`. `getNMTypeChar` calls `getSymbolNMTypeChar` for different kinds of object files.
Since I needed to do something special for ELF, I guarded my code for ELF, and mimicked the code in `getSymbolNMTypeChar`, the ELF version. `getSymbolNMTypeChar` for ELF (and also for COFF) has the same call to `getSection` and `consumeError`, without any comment indicating what they are doing.
If you have any suggestion as to what comment should go here, I will be happy to add it.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59060/new/
https://reviews.llvm.org/D59060
More information about the llvm-commits
mailing list