summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-06-05 03:00:09 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-06-05 03:00:09 +0000
commit90f9ec0dff7592c635e719909d288b5de04d224b (patch)
treef33a319a0f5dc59affb368aff2344547c6a495ce /lib/CodeGen/CGCall.cpp
parent211c8ddb5b500ed84833751363d0cfe1115f4dd3 (diff)
downloadclang-90f9ec0dff7592c635e719909d288b5de04d224b.tar.gz
clang-90f9ec0dff7592c635e719909d288b5de04d224b.tar.bz2
clang-90f9ec0dff7592c635e719909d288b5de04d224b.tar.xz
Heed ABIArgInfo::getInReg() for return values.
The 'inreg' attribute can also be applied to function return values in LLVM IR. The SPARC v9 backend is using the flag when returning structs containing 32-bit floats. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183290 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r--lib/CodeGen/CGCall.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 9a8edccdef..3c079cd58b 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -1054,8 +1054,11 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
RetAttrs.addAttribute(llvm::Attribute::SExt);
else if (RetTy->hasUnsignedIntegerRepresentation())
RetAttrs.addAttribute(llvm::Attribute::ZExt);
- break;
+ // FALL THROUGH
case ABIArgInfo::Direct:
+ if (RetAI.getInReg())
+ RetAttrs.addAttribute(llvm::Attribute::InReg);
+ break;
case ABIArgInfo::Ignore:
break;