From: Simon Pilgrim Date: Thu, 7 Jul 2016 11:24:38 +0000 (+0000) Subject: Fix "not all control paths return a value" warning on MSVC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7142d85ff4723154052125fed2bf539fa7481bd9;p=clang Fix "not all control paths return a value" warning on MSVC 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 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 4d784d5694..80b44fc635 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -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);