Skip to content

Commit

Permalink
[mips64][clang] Provide the signext attribute for i32 return values
Browse files Browse the repository at this point in the history
Additional info: see r338019.

Differential Revision: https://reviews.llvm.org/D49289

llvm-svn: 338239
  • Loading branch information
Stefan Maksimovic committed Jul 30, 2018
1 parent 0d466c4 commit b9da8a5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions clang/lib/CodeGen/TargetInfo.cpp
Expand Up @@ -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 {
Expand Down

0 comments on commit b9da8a5

Please sign in to comment.