]> granicus.if.org Git - clang/commitdiff
Clean up redundant isa<T> before getAs<T>. NFC.
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Fri, 6 Jan 2017 19:10:48 +0000 (19:10 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Fri, 6 Jan 2017 19:10:48 +0000 (19:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291264 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCall.cpp

index 9b96a59aec38d5af0c8ce31396720a680d973f30..c7c61e0c8ecb1b0d47dd034403d3a088894a6669 100644 (file)
@@ -393,15 +393,13 @@ CodeGenTypes::arrangeFunctionDeclaration(const FunctionDecl *FD) {
 
   // When declaring a function without a prototype, always use a
   // non-variadic type.
-  if (isa<FunctionNoProtoType>(FTy)) {
-    CanQual<FunctionNoProtoType> noProto = FTy.getAs<FunctionNoProtoType>();
+  if (CanQual<FunctionNoProtoType> noProto = FTy.getAs<FunctionNoProtoType>()) {
     return arrangeLLVMFunctionInfo(
         noProto->getReturnType(), /*instanceMethod=*/false,
         /*chainCall=*/false, None, noProto->getExtInfo(), {},RequiredArgs::All);
   }
 
-  assert(isa<FunctionProtoType>(FTy));
-  return arrangeFreeFunctionType(FTy.getAs<FunctionProtoType>(), FD);
+  return arrangeFreeFunctionType(FTy.castAs<FunctionProtoType>(), FD);
 }
 
 /// Arrange the argument and result information for the declaration or