TargetInfo.cpp - use castAs<> instead of getAs<> as we dereference the pointer directly. NFCI.

castAs<> will assert the correct cast type instead of just returning null, which we then try to dereference immediately.
This commit is contained in:
Simon Pilgrim 2020-11-24 16:56:24 +00:00
parent eb7ea5aa1a
commit 9d996c01aa
1 changed files with 1 additions and 1 deletions

View File

@ -10394,7 +10394,7 @@ void RISCVABIInfo::computeInfo(CGFunctionInfo &FI) const {
if (!IsRetIndirect && RetTy->isScalarType() &&
getContext().getTypeSize(RetTy) > (2 * XLen)) {
if (RetTy->isComplexType() && FLen) {
QualType EltTy = RetTy->getAs<ComplexType>()->getElementType();
QualType EltTy = RetTy->castAs<ComplexType>()->getElementType();
IsRetIndirect = getContext().getTypeSize(EltTy) > FLen;
} else {
// This is a normal scalar > 2*XLen, such as fp128 on RV32.