diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-11-24 16:56:24 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-11-25 11:38:29 +0000 |
commit | 9d996c01aad5371ccf3790ce937b1cc85d1b07ab (patch) | |
tree | 083f1d0ba9947d582dd03649a392f09dc2a1aa02 /clang/lib/CodeGen/TargetInfo.cpp | |
parent | eb7ea5aa1ac6030b7bc94c5f2fb42de675cd392f (diff) | |
download | llvm-9d996c01aad5371ccf3790ce937b1cc85d1b07ab.zip llvm-9d996c01aad5371ccf3790ce937b1cc85d1b07ab.tar.gz llvm-9d996c01aad5371ccf3790ce937b1cc85d1b07ab.tar.bz2 |
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.
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 64240b1..06b24c0 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -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. |