// 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