[llvm] r213572 - R600: silence GCC warning

Saleem Abdulrasool compnerd at compnerd.org
Mon Jul 21 10:52:00 PDT 2014


Author: compnerd
Date: Mon Jul 21 12:52:00 2014
New Revision: 213572

URL: http://llvm.org/viewvc/llvm-project?rev=213572&view=rev
Log:
R600: silence GCC warning

GCC believes it may be possible to not return a value from the switch:
  lib/Target/R600/SIRegisterInfo.cpp:187:1: warning: control reaches end of non-void function [-Wreturn-type]

Add an unreachable label to indicate that this is not possible and still permit
switch coverage checking.

Modified:
    llvm/trunk/lib/Target/R600/SIRegisterInfo.cpp

Modified: llvm/trunk/lib/Target/R600/SIRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIRegisterInfo.cpp?rev=213572&r1=213571&r2=213572&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIRegisterInfo.cpp Mon Jul 21 12:52:00 2014
@@ -184,4 +184,5 @@ unsigned SIRegisterInfo::getPreloadedVal
   case SIRegisterInfo::SCRATCH_PTR:
     return AMDGPU::SGPR2_SGPR3;
   }
+  llvm_unreachable("unexpected preloaded value type");
 }





More information about the llvm-commits mailing list