summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/Targets/ARM.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/Targets/ARM.cpp')
-rw-r--r--clang/lib/CodeGen/Targets/ARM.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/Targets/ARM.cpp b/clang/lib/CodeGen/Targets/ARM.cpp
index 3739e16788c3..c84c9f2f643e 100644
--- a/clang/lib/CodeGen/Targets/ARM.cpp
+++ b/clang/lib/CodeGen/Targets/ARM.cpp
@@ -382,8 +382,8 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty, bool isVariadic,
if (!isAggregateTypeForABI(Ty)) {
// Treat an enum type as its underlying type.
- if (const EnumType *EnumTy = Ty->getAs<EnumType>()) {
- Ty = EnumTy->getOriginalDecl()->getDefinitionOrSelf()->getIntegerType();
+ if (const auto *ED = Ty->getAsEnumDecl()) {
+ Ty = ED->getIntegerType();
}
if (const auto *EIT = Ty->getAs<BitIntType>())
@@ -512,7 +512,7 @@ static bool isIntegerLikeType(QualType Ty, ASTContext &Context,
// above, but they are not.
// Otherwise, it must be a record type.
- const RecordType *RT = Ty->getAs<RecordType>();
+ const RecordType *RT = Ty->getAsCanonical<RecordType>();
if (!RT) return false;
// Ignore records with flexible arrays.
@@ -592,9 +592,8 @@ ABIArgInfo ARMABIInfo::classifyReturnType(QualType RetTy, bool isVariadic,
if (!isAggregateTypeForABI(RetTy)) {
// Treat an enum type as its underlying type.
- if (const EnumType *EnumTy = RetTy->getAs<EnumType>())
- RetTy =
- EnumTy->getOriginalDecl()->getDefinitionOrSelf()->getIntegerType();
+ if (const auto *ED = RetTy->getAsEnumDecl())
+ RetTy = ED->getIntegerType();
if (const auto *EIT = RetTy->getAs<BitIntType>())
if (EIT->getNumBits() > 64)
@@ -718,9 +717,8 @@ bool ARMABIInfo::containsAnyFP16Vectors(QualType Ty) const {
if (NElements == 0)
return false;
return containsAnyFP16Vectors(AT->getElementType());
- } else if (const RecordType *RT = Ty->getAs<RecordType>()) {
- const RecordDecl *RD = RT->getOriginalDecl()->getDefinitionOrSelf();
-
+ }
+ if (const auto *RD = Ty->getAsRecordDecl()) {
// If this is a C++ record, check the bases first.
if (const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(RD))
if (llvm::any_of(CXXRD->bases(), [this](const CXXBaseSpecifier &B) {