]> granicus.if.org Git - clang/commitdiff
Fix "not all control paths return a value" warning on MSVC
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 7 Jul 2016 11:24:38 +0000 (11:24 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 7 Jul 2016 11:24:38 +0000 (11:24 +0000)
This time without causing a 'all enums handled' warning on other compilers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274748 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp

index 4d784d5694ac389b6b22407658780f57c4848da4..80b44fc635387b1285f7328fbd4c7d94b4fd3df7 100644 (file)
@@ -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);