[llvm-commits] [llvm] r141313 - /llvm/trunk/lib/VMCore/Core.cpp
    Duncan Sands 
    baldrick at free.fr
       
    Fri Oct  7 00:38:14 PDT 2011
    
    
  
Hi Matt,
> --- llvm/trunk/lib/VMCore/Core.cpp (original)
> +++ llvm/trunk/lib/VMCore/Core.cpp Thu Oct  6 15:59:09 2011
> @@ -666,6 +666,7 @@
>   	default:
>   	    assert(false&&  "Unhandled Opcode.");
>       }
> +    return static_cast<LLVMOpcode>(0);
>   }
>
>   static int map_from_llvmopcode(LLVMOpcode code)
> @@ -677,6 +678,7 @@
>   	default:
>   	    assert(false&&  "Unhandled Opcode.");
>       }
> +    return 0;
>   }
the usual LLVM style is to put the default case at the start of the switch
rather than at the end.  That way in a -Asserts build control will just
fall through to the first case, so you won't get a warning.
Ciao, Duncan.
    
    
More information about the llvm-commits
mailing list