summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/Targets/Hexagon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/Targets/Hexagon.cpp')
-rw-r--r--clang/lib/CodeGen/Targets/Hexagon.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/Targets/Hexagon.cpp b/clang/lib/CodeGen/Targets/Hexagon.cpp
index 0c423429eda4..97a9300a1b8c 100644
--- a/clang/lib/CodeGen/Targets/Hexagon.cpp
+++ b/clang/lib/CodeGen/Targets/Hexagon.cpp
@@ -97,8 +97,8 @@ ABIArgInfo HexagonABIInfo::classifyArgumentType(QualType Ty,
unsigned *RegsLeft) const {
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();
uint64_t Size = getContext().getTypeSize(Ty);
if (Size <= 64)
@@ -160,9 +160,8 @@ ABIArgInfo HexagonABIInfo::classifyReturnType(QualType RetTy) const {
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 (Size > 64 && RetTy->isBitIntType())
return getNaturalAlignIndirect(