Use the "undergoes default argument promotion" bit on parameters to
simplify the logic of initializing function parameters so that we don't need both a variable declaration and a type in FunctionArgList. This also means that we need to propagate the CGFunctionInfo down in a lot of places rather than recalculating it from the FAL. There's more we can do to eliminate redundancy here, and I've left FIXMEs behind to do it. llvm-svn: 127314
This commit is contained in:
@@ -589,8 +589,7 @@ static void EmitMemberInitializer(CodeGenFunction &CGF,
|
||||
// we know we're in a copy constructor.
|
||||
unsigned SrcArgIndex = Args.size() - 1;
|
||||
llvm::Value *SrcPtr
|
||||
= CGF.Builder.CreateLoad(
|
||||
CGF.GetAddrOfLocalVar(Args[SrcArgIndex].first));
|
||||
= CGF.Builder.CreateLoad(CGF.GetAddrOfLocalVar(Args[SrcArgIndex]));
|
||||
LValue Src = CGF.EmitLValueForFieldInitialization(SrcPtr, Field, 0);
|
||||
|
||||
// Copy the aggregate.
|
||||
@@ -1244,7 +1243,7 @@ CodeGenFunction::EmitDelegateCXXConstructorCall(const CXXConstructorDecl *Ctor,
|
||||
|
||||
// this
|
||||
DelegateArgs.push_back(std::make_pair(RValue::get(LoadCXXThis()),
|
||||
I->second));
|
||||
(*I)->getType()));
|
||||
++I;
|
||||
|
||||
// vtt
|
||||
@@ -1255,14 +1254,14 @@ CodeGenFunction::EmitDelegateCXXConstructorCall(const CXXConstructorDecl *Ctor,
|
||||
|
||||
if (CodeGenVTables::needsVTTParameter(CurGD)) {
|
||||
assert(I != E && "cannot skip vtt parameter, already done with args");
|
||||
assert(I->second == VoidPP && "skipping parameter not of vtt type");
|
||||
assert((*I)->getType() == VoidPP && "skipping parameter not of vtt type");
|
||||
++I;
|
||||
}
|
||||
}
|
||||
|
||||
// Explicit arguments.
|
||||
for (; I != E; ++I) {
|
||||
const VarDecl *Param = I->first;
|
||||
const VarDecl *Param = *I;
|
||||
QualType ArgType = Param->getType(); // because we're passing it to itself
|
||||
RValue Arg = EmitDelegateCallArg(Param);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user