diff options
| author | John McCall <rjmccall@apple.com> | 2011-03-09 04:27:21 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2011-03-09 04:27:21 +0000 |
| commit | a738c25f5e095b2c72c4bfece65c00df7e23d750 (patch) | |
| tree | d918394b131d7b9c02eb8455ef71b5b49e97b524 /clang/lib/CodeGen/CGClass.cpp | |
| parent | 6a014d5c3069e3861f3abd7e6bb43e7c85e0b84b (diff) | |
| download | llvm-a738c25f5e095b2c72c4bfece65c00df7e23d750.zip llvm-a738c25f5e095b2c72c4bfece65c00df7e23d750.tar.gz llvm-a738c25f5e095b2c72c4bfece65c00df7e23d750.tar.bz2 | |
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
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index fbc5f3f..1a0a59e 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -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); |
