]> granicus.if.org Git - llvm/commitdiff
[TLI] Appease spurious MSVC warning using llvm_unreachable. NFC.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Tue, 17 Jan 2017 19:54:18 +0000 (19:54 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Tue, 17 Jan 2017 19:54:18 +0000 (19:54 +0000)
r292188 confused MSVC because of the combined lack of a default
case and return statement.

Move the unreachable outside of the NumLibFuncs case, to make it
obvious that all cases should be handled.

llvm_unreachable is __declspec(noreturn), so I'm assuming this
does appease MSVC.

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

lib/Analysis/TargetLibraryInfo.cpp

index 27e98035991b02aef0d3dd8ea9e0384308cf798e..aea29e6359dea3fdc5f56b6f87a916d82c4d74d9 100644 (file)
@@ -1177,9 +1177,10 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
             FTy.getParamType(1) == SizeTTy && FTy.getParamType(2) == SizeTTy);
 
   case LibFunc::NumLibFuncs:
-    llvm_unreachable("Invalid sentinel libfunc value");
+    break;
   }
 
+  llvm_unreachable("Invalid libfunc");
 }
 
 bool TargetLibraryInfoImpl::getLibFunc(const Function &FDecl,