[llvm] r305143 - Added llvm_unreachable as ReportError cannot be specified as noreturn.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 12 09:53:10 PDT 2017


Why can't ReportError be noreturn?

On Sat, Jun 10, 2017 at 12:50 AM Galina Kistanova via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: gkistanova
> Date: Sat Jun 10 02:50:14 2017
> New Revision: 305143
>
> URL: http://llvm.org/viewvc/llvm-project?rev=305143&view=rev
> Log:
> Added llvm_unreachable as ReportError cannot be specified as noreturn.
>
> Modified:
>     llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
>
> Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp?rev=305143&r1=305142&r2=305143&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp Sat Jun 10 02:50:14
> 2017
> @@ -585,6 +585,7 @@ void DWARFDebugFrame::parse(DataExtracto
>            switch (AugmentationString[i]) {
>              default:
>                ReportError("Unknown augmentation character in entry at
> %lx");
> +              llvm_unreachable("ReportError should not return.");
>              case 'L':
>                LSDAPointerEncoding = Data.getU8(&Offset);
>                break;
>
>
> _______________________________________________
> 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/20170612/8e29d62d/attachment.html>


More information about the llvm-commits mailing list