diff options
author | Stefan Maksimovic <stefan.maksimovic@mips.com> | 2018-07-30 10:44:46 +0000 |
---|---|---|
committer | Stefan Maksimovic <stefan.maksimovic@mips.com> | 2018-07-30 10:44:46 +0000 |
commit | b9da8a5dff8d07392ff4f7dcc45c9d7ff0836e28 (patch) | |
tree | 86eb6bba1d79aba7be49fb83f2646807f71099b8 /clang/lib/CodeGen/TargetInfo.cpp | |
parent | 0d466c41ff589665bfd427cf5c5096b3c932a88c (diff) | |
download | llvm-b9da8a5dff8d07392ff4f7dcc45c9d7ff0836e28.zip llvm-b9da8a5dff8d07392ff4f7dcc45c9d7ff0836e28.tar.gz llvm-b9da8a5dff8d07392ff4f7dcc45c9d7ff0836e28.tar.bz2 |
[mips64][clang] Provide the signext attribute for i32 return values
Additional info: see r338019.
Differential Revision: https://reviews.llvm.org/D49289
llvm-svn: 338239
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index fa9b0a2..7652cb1 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -6985,8 +6985,14 @@ ABIArgInfo MipsABIInfo::classifyReturnType(QualType RetTy) const { if (const EnumType *EnumTy = RetTy->getAs<EnumType>()) RetTy = EnumTy->getDecl()->getIntegerType(); - return (RetTy->isPromotableIntegerType() ? ABIArgInfo::getExtend(RetTy) - : ABIArgInfo::getDirect()); + if (RetTy->isPromotableIntegerType()) + return ABIArgInfo::getExtend(RetTy); + + if ((RetTy->isUnsignedIntegerOrEnumerationType() || + RetTy->isSignedIntegerOrEnumerationType()) && Size == 32 && !IsO32) + return ABIArgInfo::getSignExtend(RetTy); + + return ABIArgInfo::getDirect(); } void MipsABIInfo::computeInfo(CGFunctionInfo &FI) const { |