aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCGNU.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-06-24 17:04:18 +0000
committerChris Lattner <sabre@nondot.org>2008-06-24 17:04:18 +0000
commit8fdf32822be2238aa7db62d40e75b168b637ab7d (patch)
treeada1e774883de35a2b97a8711f890753d4986543 /lib/CodeGen/CGObjCGNU.cpp
parent4e0b2641d8aa8da8eb001b959940a9ec68f45f0d (diff)
"Support for Objective-C message sends which return structures. Also includes a small fix for constant string handling that should have been in the last patch (sorry!) and a hook for generating selectors (rest of this implementation to follow in the next patch)."
Patch by David Chisnall! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCGNU.cpp')
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index 2f02b13ee6..53eaf57560 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -405,11 +405,14 @@ llvm::Value *CGObjCGNU::GenerateMessageSend(llvm::IRBuilder &Builder,
if (!ReturnTy->isSingleValueType()) {
llvm::Value *Return = Builder.CreateAlloca(ReturnTy);
Args.push_back(Return);
- return Return;
}
Args.push_back(Receiver);
Args.push_back(cmd);
Args.insert(Args.end(), ArgV, ArgV+ArgC);
+ if (!ReturnTy->isSingleValueType()) {
+ Builder.CreateCall(imp, Args.begin(), Args.end());
+ return Args[0];
+ }
return Builder.CreateCall(imp, Args.begin(), Args.end());
}
@@ -887,7 +890,7 @@ llvm::Function *CGObjCGNU::MethodPreamble(
bool isClassMethod,
bool isVarArg) {
std::vector<const llvm::Type*> Args;
- if (!ReturnTy->isFirstClassType() && ReturnTy != llvm::Type::VoidTy) {
+ if (!ReturnTy->isSingleValueType() && ReturnTy != llvm::Type::VoidTy) {
Args.push_back(llvm::PointerType::getUnqual(ReturnTy));
ReturnTy = llvm::Type::VoidTy;
}