summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorPetar Jovanovic <petar.jovanovic@imgtec.com>2015-05-26 13:30:54 +0000
committerPetar Jovanovic <petar.jovanovic@imgtec.com>2015-05-26 13:30:54 +0000
commit9aa0f1657f5477eca7c816079728aa358444a23b (patch)
tree709eb05dc0369861c19107d56879dc1fb82a210a /clang/lib/CodeGen/CGCall.cpp
parent0af4f635f184137a437f2c08a45c4661c86e8459 (diff)
downloadbcm5719-llvm-9aa0f1657f5477eca7c816079728aa358444a23b.tar.gz
bcm5719-llvm-9aa0f1657f5477eca7c816079728aa358444a23b.zip
[MIPS] fix extension of integer types (function calls)
On MIPS unsigned int type should not be zero extended but sign-extended. Patch by Strahinja Petrovic. Differential Revision: http://reviews.llvm.org/D9198 llvm-svn: 238200
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index b73ad9e4fb5..f2340530d66 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1588,8 +1588,12 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
case ABIArgInfo::Extend:
if (ParamType->isSignedIntegerOrEnumerationType())
Attrs.addAttribute(llvm::Attribute::SExt);
- else if (ParamType->isUnsignedIntegerOrEnumerationType())
- Attrs.addAttribute(llvm::Attribute::ZExt);
+ else if (ParamType->isUnsignedIntegerOrEnumerationType()) {
+ if (getTypes().getABIInfo().shouldSignExtUnsignedType(ParamType))
+ Attrs.addAttribute(llvm::Attribute::SExt);
+ else
+ Attrs.addAttribute(llvm::Attribute::ZExt);
+ }
// FALL THROUGH
case ABIArgInfo::Direct:
if (ArgNo == 0 && FI.isChainCall())
OpenPOWER on IntegriCloud