[lld] r258499 - Use of llvm_unreachable instead of warning in EhFrameHeader<ELFT>::assignEhFrame().

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 07:42:16 PST 2016


On Fri, Jan 22, 2016 at 2:57 AM, George Rimar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: grimar
> Date: Fri Jan 22 04:57:39 2016
> New Revision: 258499
>
> URL: http://llvm.org/viewvc/llvm-project?rev=258499&view=rev
> Log:
> Use of llvm_unreachable instead of warning in
> EhFrameHeader<ELFT>::assignEhFrame().
>
> Modified:
>     lld/trunk/ELF/OutputSections.cpp
>
> Modified: lld/trunk/ELF/OutputSections.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=258499&r1=258498&r2=258499&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/OutputSections.cpp (original)
> +++ lld/trunk/ELF/OutputSections.cpp Fri Jan 22 04:57:39 2016
> @@ -863,11 +863,8 @@ template <class ELFT> void EhFrameHeader
>
>  template <class ELFT>
>  void EhFrameHeader<ELFT>::assignEhFrame(EHOutputSection<ELFT> *Sec) {
> -  if (this->Sec && this->Sec != Sec) {
> -    warning("multiple .eh_frame sections not supported for
> .eh_frame_hdr");
> -    Live = false;
> -    return;
> -  }
> +  if (this->Sec && this->Sec != Sec)
> +    llvm_unreachable("multiple .eh_frame sections not supported for
> .eh_frame_hdr");
>

This should probably be written with an assert instead:

  assert((!this->Sec || this->Sec == Sec) && "multiple .eh_frame sections
....");


>    Live = Config->EhFrameHdr;
>    this->Sec = Sec;
>  }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160122/a80c92b6/attachment.html>


More information about the llvm-commits mailing list