From 7f8ea5c5b3a6a4332a841eefdd86b0726722ea7b Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 30 Aug 2008 05:35:15 +0000 Subject: Add Objective-C property setter support. - Change Obj-C runtime message API, drop the ObjCMessageExpr arg in favor of just result type and selector. Necessary so it can be reused in situations where we don't want to cons up an ObjCMessageExpr. - Update aggregate binary assignment to know about special property ref lvalues. - Add CodeGenFunction::EmitCallArg overload which takes an already emitted rvalue. Add CodeGenFunction::StoreComplexIntoAddr. Disabled logic in Sema for parsing Objective-C dot-syntax that accesses methods. This code does not search in the correct order and the AST node has no way of properly representing its results. Updated StmtDumper to print a bit more information about ObjCPropertyRefExprs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55561 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index c8aa26155e..e1893493b0 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -830,6 +830,24 @@ RValue CodeGenFunction::EmitCallExpr(llvm::Value *Callee, QualType FnType, return EmitCall(Callee, ResultType, Args); } +// FIXME: Merge the following two functions. +void CodeGenFunction::EmitCallArg(RValue RV, QualType Ty, + CallArgList &Args) { + llvm::Value *ArgValue; + + if (RV.isScalar()) { + ArgValue = RV.getScalarVal(); + } else if (RV.isComplex()) { + // Make a temporary alloca to pass the argument. + ArgValue = CreateTempAlloca(ConvertType(Ty)); + StoreComplexToAddr(RV.getComplexVal(), ArgValue, false); + } else { + ArgValue = RV.getAggregateAddr(); + } + + Args.push_back(std::make_pair(ArgValue, Ty)); +} + void CodeGenFunction::EmitCallArg(const Expr *E, CallArgList &Args) { QualType ArgTy = E->getType(); llvm::Value *ArgValue; -- cgit v1.2.3