[cfe-commits] r92138 - in /cfe/trunk/lib/CodeGen: CGBlocks.cpp CGCXX.cpp CGCall.cpp CGDecl.cpp CGException.cpp CGExpr.cpp CGExprCXX.cpp CGObjC.cpp CGObjCGNU.cpp CGObjCMac.cpp CodeGenFunction.h
Anders Carlsson
andersca at mac.com
Thu Dec 24 11:25:24 PST 2009
Author: andersca
Date: Thu Dec 24 13:25:24 2009
New Revision: 92138
URL: http://llvm.org/viewvc/llvm-project?rev=92138&view=rev
Log:
Pass ReturnValueSlot to EmitCall. No functionality change yet.
Modified:
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/lib/CodeGen/CGCXX.cpp
cfe/trunk/lib/CodeGen/CGCall.cpp
cfe/trunk/lib/CodeGen/CGDecl.cpp
cfe/trunk/lib/CodeGen/CGException.cpp
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CGExprCXX.cpp
cfe/trunk/lib/CodeGen/CGObjC.cpp
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.h
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=92138&r1=92137&r2=92138&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Thu Dec 24 13:25:24 2009
@@ -509,7 +509,7 @@
Func = Builder.CreateBitCast(Func, BlockFTyPtr);
// And call the block.
- return EmitCall(FnInfo, Func, Args);
+ return EmitCall(FnInfo, Func, ReturnValueSlot(), Args);
}
uint64_t CodeGenFunction::AllocateBlockDecl(const BlockDeclRefExpr *E) {
Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=92138&r1=92137&r2=92138&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Thu Dec 24 13:25:24 2009
@@ -46,8 +46,8 @@
EmitCallArgs(Args, FPT, ArgBeg, ArgEnd);
QualType ResultType = MD->getType()->getAs<FunctionType>()->getResultType();
- return EmitCall(CGM.getTypes().getFunctionInfo(ResultType, Args),
- Callee, Args, MD);
+ return EmitCall(CGM.getTypes().getFunctionInfo(ResultType, Args), Callee,
+ ReturnValueSlot(), Args, MD);
}
/// canDevirtualizeMemberFunctionCalls - Checks whether virtual calls on given
@@ -246,8 +246,8 @@
// And the rest of the call args
EmitCallArgs(Args, FPT, E->arg_begin(), E->arg_end());
QualType ResultType = BO->getType()->getAs<FunctionType>()->getResultType();
- return EmitCall(CGM.getTypes().getFunctionInfo(ResultType, Args),
- Callee, Args, 0);
+ return EmitCall(CGM.getTypes().getFunctionInfo(ResultType, Args), Callee,
+ ReturnValueSlot(), Args);
}
RValue
@@ -551,7 +551,8 @@
// FIXME: We should try to share this code with EmitCXXMemberCall.
QualType ResultType = DD->getType()->getAs<FunctionType>()->getResultType();
- EmitCall(CGM.getTypes().getFunctionInfo(ResultType, Args), Callee, Args, DD);
+ EmitCall(CGM.getTypes().getFunctionInfo(ResultType, Args), Callee,
+ ReturnValueSlot(), Args, DD);
}
void
@@ -801,7 +802,7 @@
}
RValue RV = EmitCall(CGM.getTypes().getFunctionInfo(ResultType, CallArgs),
- Callee, CallArgs, MD);
+ Callee, ReturnValueSlot(), CallArgs, MD);
if (ShouldAdjustReturnPointer && !Adjustment.ReturnAdjustment.isEmpty()) {
bool CanBeZero = !(ResultType->isReferenceType()
// FIXME: attr nonnull can't be zero either
@@ -1111,7 +1112,7 @@
QualType ResultType =
BaseCopyCtor->getType()->getAs<FunctionType>()->getResultType();
EmitCall(CGM.getTypes().getFunctionInfo(ResultType, CallArgs),
- Callee, CallArgs, BaseCopyCtor);
+ Callee, ReturnValueSlot(), CallArgs, BaseCopyCtor);
}
EmitBlock(ContinueBlock);
@@ -1195,7 +1196,7 @@
MD->getParamDecl(0)->getType()));
QualType ResultType = MD->getType()->getAs<FunctionType>()->getResultType();
EmitCall(CGM.getTypes().getFunctionInfo(ResultType, CallArgs),
- Callee, CallArgs, MD);
+ Callee, ReturnValueSlot(), CallArgs, MD);
}
EmitBlock(ContinueBlock);
@@ -1245,7 +1246,7 @@
QualType ResultType =
BaseCopyCtor->getType()->getAs<FunctionType>()->getResultType();
EmitCall(CGM.getTypes().getFunctionInfo(ResultType, CallArgs),
- Callee, CallArgs, BaseCopyCtor);
+ Callee, ReturnValueSlot(), CallArgs, BaseCopyCtor);
}
}
@@ -1292,7 +1293,7 @@
QualType ResultType =
MD->getType()->getAs<FunctionType>()->getResultType();
EmitCall(CGM.getTypes().getFunctionInfo(ResultType, CallArgs),
- Callee, CallArgs, MD);
+ Callee, ReturnValueSlot(), CallArgs, MD);
}
/// SynthesizeDefaultConstructor - synthesize a default constructor
Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=92138&r1=92137&r2=92138&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Thu Dec 24 13:25:24 2009
@@ -809,6 +809,7 @@
RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
llvm::Value *Callee,
+ ReturnValueSlot ReturnValue,
const CallArgList &CallArgs,
const Decl *TargetDecl) {
// FIXME: We no longer need the types from CallArgs; lift up and simplify.
Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=92138&r1=92137&r2=92138&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Thu Dec 24 13:25:24 2009
@@ -643,7 +643,7 @@
Args.push_back(std::make_pair(RValue::get(Builder.CreateBitCast(DeclPtr,
ConvertType(ArgTy))),
getContext().getPointerType(D.getType())));
- EmitCall(Info, F, Args);
+ EmitCall(Info, F, ReturnValueSlot(), Args);
}
if (Exceptions) {
EHCleanupBlock Cleanup(*this);
@@ -652,7 +652,7 @@
Args.push_back(std::make_pair(RValue::get(Builder.CreateBitCast(DeclPtr,
ConvertType(ArgTy))),
getContext().getPointerType(D.getType())));
- EmitCall(Info, F, Args);
+ EmitCall(Info, F, ReturnValueSlot(), Args);
}
}
Modified: cfe/trunk/lib/CodeGen/CGException.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=92138&r1=92137&r2=92138&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGException.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGException.cpp Thu Dec 24 13:25:24 2009
@@ -197,7 +197,7 @@
QualType ResultType =
CopyCtor->getType()->getAs<FunctionType>()->getResultType();
CGF.EmitCall(CGF.CGM.getTypes().getFunctionInfo(ResultType, CallArgs),
- Callee, CallArgs, CopyCtor);
+ Callee, ReturnValueSlot(), CallArgs, CopyCtor);
CGF.setInvokeDest(PrevLandingPad);
} else
llvm_unreachable("uncopyable object");
@@ -239,7 +239,7 @@
QualType ResultType =
CopyCtor->getType()->getAs<FunctionType>()->getResultType();
CGF.EmitCall(CGF.CGM.getTypes().getFunctionInfo(ResultType, CallArgs),
- Callee, CallArgs, CopyCtor);
+ Callee, ReturnValueSlot(), CallArgs, CopyCtor);
} else
llvm_unreachable("uncopyable object");
}
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=92138&r1=92137&r2=92138&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Thu Dec 24 13:25:24 2009
@@ -1737,7 +1737,7 @@
CallingConvention = F->getCallingConv();
return EmitCall(CGM.getTypes().getFunctionInfo(ResultType, Args,
CallingConvention),
- Callee, Args, TargetDecl);
+ Callee, ReturnValueSlot(), Args, TargetDecl);
}
LValue CodeGenFunction::
Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprCXX.cpp?rev=92138&r1=92137&r2=92138&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Thu Dec 24 13:25:24 2009
@@ -212,7 +212,7 @@
// Emit the call to new.
RValue RV =
EmitCall(CGM.getTypes().getFunctionInfo(NewFTy->getResultType(), NewArgs),
- CGM.GetAddrOfFunction(NewFD), NewArgs, NewFD);
+ CGM.GetAddrOfFunction(NewFD), ReturnValueSlot(), NewArgs, NewFD);
// If an allocation function is declared with an empty exception specification
// it returns null to indicate failure to allocate storage. [expr.new]p13.
@@ -354,7 +354,7 @@
// Emit the call to delete.
EmitCall(CGM.getTypes().getFunctionInfo(DeleteFTy->getResultType(),
DeleteArgs),
- CGM.GetAddrOfFunction(DeleteFD),
+ CGM.GetAddrOfFunction(DeleteFD), ReturnValueSlot(),
DeleteArgs, DeleteFD);
}
Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=92138&r1=92137&r2=92138&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Thu Dec 24 13:25:24 2009
@@ -190,7 +190,7 @@
// FIXME: We shouldn't need to get the function info here, the
// runtime already should have computed it to build the function.
RValue RV = EmitCall(Types.getFunctionInfo(PD->getType(), Args),
- GetPropertyFn, Args);
+ GetPropertyFn, ReturnValueSlot(), Args);
// We need to fix the type here. Ivars with copy & retain are
// always objects so we don't need to worry about complex or
// aggregates.
@@ -277,8 +277,8 @@
getContext().BoolTy));
// FIXME: We shouldn't need to get the function info here, the runtime
// already should have computed it to build the function.
- EmitCall(Types.getFunctionInfo(getContext().VoidTy, Args),
- SetPropertyFn, Args);
+ EmitCall(Types.getFunctionInfo(getContext().VoidTy, Args), SetPropertyFn,
+ ReturnValueSlot(), Args);
} else {
// FIXME: Find a clean way to avoid AST node creation.
SourceLocation Loc = PD->getLocation();
@@ -553,7 +553,7 @@
// FIXME: We shouldn't need to get the function info here, the runtime already
// should have computed it to build the function.
EmitCall(CGM.getTypes().getFunctionInfo(getContext().VoidTy, Args2),
- EnumerationMutationFn, Args2);
+ EnumerationMutationFn, ReturnValueSlot(), Args2);
EmitBlock(WasNotMutated);
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=92138&r1=92137&r2=92138&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Thu Dec 24 13:25:24 2009
@@ -450,7 +450,7 @@
llvm::Value *imp = CGF.Builder.CreateCall(lookupFunction, lookupArgs,
lookupArgs+2);
- return CGF.EmitCall(FnInfo, imp, ActualArgs);
+ return CGF.EmitCall(FnInfo, imp, ReturnValueSlot(), ActualArgs);
}
/// Generate code for a message send expression.
@@ -536,7 +536,7 @@
imp = Builder.CreateCall2(lookupFunction, Receiver, cmd);
}
- return CGF.EmitCall(FnInfo, imp, ActualArgs);
+ return CGF.EmitCall(FnInfo, imp, ReturnValueSlot(), ActualArgs);
}
/// Generates a MethodList. Used in construction of a objc_class and
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=92138&r1=92137&r2=92138&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Thu Dec 24 13:25:24 2009
@@ -1581,7 +1581,7 @@
assert(Fn && "EmitLegacyMessageSend - unknown API");
Fn = llvm::ConstantExpr::getBitCast(Fn,
llvm::PointerType::getUnqual(FTy));
- return CGF.EmitCall(FnInfo, Fn, ActualArgs);
+ return CGF.EmitCall(FnInfo, Fn, ReturnValueSlot(), ActualArgs);
}
llvm::Value *CGObjCMac::GenerateProtocolRef(CGBuilderTy &Builder,
@@ -5169,7 +5169,7 @@
const llvm::FunctionType *FTy = Types.GetFunctionType(FnInfo1, true);
Callee = CGF.Builder.CreateBitCast(Callee,
llvm::PointerType::getUnqual(FTy));
- return CGF.EmitCall(FnInfo1, Callee, ActualArgs);
+ return CGF.EmitCall(FnInfo1, Callee, ReturnValueSlot(), ActualArgs);
}
/// Generate code for a message send expression in the nonfragile abi.
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=92138&r1=92137&r2=92138&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Thu Dec 24 13:25:24 2009
@@ -1036,6 +1036,7 @@
/// used to set attributes on the call (noreturn, etc.).
RValue EmitCall(const CGFunctionInfo &FnInfo,
llvm::Value *Callee,
+ ReturnValueSlot ReturnValue,
const CallArgList &Args,
const Decl *TargetDecl = 0);
More information about the cfe-commits
mailing list