[llvm] r236261 - Replace unreachable code with llvm_unreachable.

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu Apr 30 15:15:10 PDT 2015


> On 2015-Apr-30, at 14:20, Rafael Espindola <rafael.espindola at gmail.com> wrote:
> 
> Author: rafael
> Date: Thu Apr 30 16:20:06 2015
> New Revision: 236261
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=236261&view=rev
> Log:
> Replace unreachable code with llvm_unreachable.
> 
> Modified:
>    llvm/trunk/lib/MC/ELFObjectWriter.cpp
> 
> Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=236261&r1=236260&r2=236261&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
> +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Thu Apr 30 16:20:06 2015
> @@ -1338,7 +1338,7 @@ void ELFObjectWriter::writeSection(MCAss
>     break;
> 
>   case ELF::SHT_DYNAMIC:
> -    sh_link = ShStrTabBuilder.getOffset(Section.getSectionName());
> +    llvm_unreachable("SHT_DYNAMIC in a relocatable object");
>     break;

You can kill the `break` too I think.

> 
>   case ELF::SHT_REL:
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list