[llvm] r232913 - Fixed MSVC compile warning issue introduced in r232837

David Majnemer david.majnemer at gmail.com
Sun Mar 22 14:32:16 PDT 2015


On Sun, Mar 22, 2015 at 6:38 AM, Simon Pilgrim <llvm-dev at redking.me.uk>
wrote:

> Author: rksimon
> Date: Sun Mar 22 08:38:36 2015
> New Revision: 232913
>
> URL: http://llvm.org/viewvc/llvm-project?rev=232913&view=rev
> Log:
> Fixed MSVC compile warning issue introduced in r232837
>
> - was reporting 'warning C4715: 'getType32' : not all control paths return
> a value'
>
> Modified:
>     llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
>
> Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp?rev=232913&r1=232912&r2=232913&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
> (original)
> +++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp Sun Mar
> 22 08:38:36 2015
> @@ -164,7 +164,8 @@ enum X86_32RelType { RT32_32, RT32_16, R
>
>  static X86_32RelType getType32(X86_64RelType T) {
>    switch (T) {
> -  case RT64_64:
> +  default:
>

This switch was fully covered.  The coding standard recommends not to have
default cases for fully covered switches:
http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations


> +  //case RT64_64:
>

Please avoid commenting out code.  This can be confusing to those who
revisit the code later.


>      llvm_unreachable("Unimplemented");
>    case RT64_32:
>    case RT64_32S:
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150322/42997e57/attachment.html>


More information about the llvm-commits mailing list