[lld] r194624 - Remove default label from fully covered switch.
ruiu at google.com
Wed Nov 13 22:39:25 PST 2013
On Wed, Nov 13, 2013 at 10:31 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:
> On 2013 Nov 13, at 21:41, Rui Ueyama <ruiu at google.com> wrote:
> > On Wed, Nov 13, 2013 at 7:21 PM, Duncan Exon Smith <dexonsmith at apple.com>
> > On Nov 13, 2013, at 3:33 PM, Rui Ueyama <ruiu at google.com> wrote:
> > > case NCR_Error:
> > > llvm::errs() << "SymbolTable: error while merging " << name <<
> > > - // FALLTHRU
> > > - default:
> > > - llvm::report_fatal_error("SymbolTable::addByName(): unhandled
> switch clause");
> > > }
> > Was the change in behavior intended, or should you add a new
> report_fatal_error() call?
> > This change is kind of intended. If something wrong in the input, we
> sometimes terminate the linker immediately, and sometimes continue
> processing after printing an error with llvm::err(). Previously the linker
> is terminated with pretty vague error message ("unhandled switch clause").
> With this patch it proceed after printing an error. I was OK in either way,
> so I just removed default label. I should have made this point clear in the
> commit log. Sorry about that.
> NCR_Error specifically indicates that one of the symbols is absolute;
> interesting that this isn’t worth terminating over. I see that some
> duplicate definitions result in termination. However, as long as new
> behavior is intentional, you may want to change the llvm::errs printout to
> “lld warning: ...” and be more explicit than “error while merging”.
Yeah, on the second thought, terminating the program would make more sense
than continuing the process as you said. Thank you for pointing out. I will
address that in a followup patch.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits