r274748 - Fix "not all control paths return a value" warning on MSVC

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 7 04:24:39 PDT 2016


Author: rksimon
Date: Thu Jul  7 06:24:38 2016
New Revision: 274748

URL: http://llvm.org/viewvc/llvm-project?rev=274748&view=rev
Log:
Fix "not all control paths return a value" warning on MSVC

This time without causing a 'all enums handled' warning on other compilers.

Modified:
    cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=274748&r1=274747&r2=274748&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Thu Jul  7 06:24:38 2016
@@ -1777,7 +1777,7 @@ public:
       // Set __CUDA_ARCH__ for the GPU specified.
       std::string CUDAArchCode = [this] {
         switch (GPU) {
-        case CudaArch::UNKNOWN:
+        default:
           assert(false && "No GPU arch when compiling CUDA device code.");
           return "";
         case CudaArch::SM_20:
@@ -1804,8 +1804,6 @@ public:
           return "610";
         case CudaArch::SM_62:
           return "620";
-         default:
-           llvm_unreachable("unhandled CudaArch");
         }
       }();
       Builder.defineMacro("__CUDA_ARCH__", CUDAArchCode);




More information about the cfe-commits mailing list