summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-10-19 05:04:37 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-10-19 05:04:37 +0000
commit703c47f80784486bc22fd77371f4423b61c4fb44 (patch)
tree964658eb0f7e024b2255786996a99b6e9ea23f94 /clang/lib/CodeGen/CGCall.cpp
parent5e79ee087e9eacc311d4abca736c734fb1012f18 (diff)
downloadbcm5719-llvm-703c47f80784486bc22fd77371f4423b61c4fb44.tar.gz
bcm5719-llvm-703c47f80784486bc22fd77371f4423b61c4fb44.zip
Fix handling of the regparm attribute in the presence of classes with copy
constructors. When I first moved regparm support to TargetInfo.cpp I tried to isolate it in classifyArgumentTypeWithReg, but it is actually a lot easier to flip the code around and check for regparm at the end of the decision tree. Without this refactoring classifyArgumentTypeWithReg would have to duplicate the logic about when to use non-byval indirect arguments. llvm-svn: 166266
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 2ef5bd27a0a..afcf541a3d3 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1051,6 +1051,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
break;
case ABIArgInfo::Indirect:
+ if (AI.getInReg())
+ Attrs.addAttribute(llvm::Attributes::InReg);
+
if (AI.getIndirectByVal())
Attrs.addAttribute(llvm::Attributes::ByVal);
OpenPOWER on IntegriCloud