diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2009-10-28 21:07:28 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-10-28 21:07:28 +0000 |
| commit | 29baa2b1ba617ab6d79483f46ed6f99a7b3bcdfd (patch) | |
| tree | 44499725f1178c26f50388ea04d9af559622603c /clang/lib/CodeGen/CGCXX.cpp | |
| parent | f1639fffbc2375e71a693f1eb7c5f23e9dc8901e (diff) | |
| download | bcm5719-llvm-29baa2b1ba617ab6d79483f46ed6f99a7b3bcdfd.tar.gz bcm5719-llvm-29baa2b1ba617ab6d79483f46ed6f99a7b3bcdfd.zip | |
Minor cleanup.
llvm-svn: 85434
Diffstat (limited to 'clang/lib/CodeGen/CGCXX.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGCXX.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp index 345eacb673e..818c5162daf 100644 --- a/clang/lib/CodeGen/CGCXX.cpp +++ b/clang/lib/CodeGen/CGCXX.cpp @@ -591,11 +591,13 @@ CodeGenFunction::EmitCXXConstructExpr(llvm::Value *Dest, const CXXConstructExpr *E) { assert(Dest && "Must have a destination!"); const CXXConstructorDecl *CD = E->getConstructor(); + const ConstantArrayType *Array = + getContext().getAsConstantArrayType(E->getType()); // For a copy constructor, even if it is trivial, must fall thru so // its argument is code-gen'ed. if (!CD->isCopyConstructor(getContext())) { QualType InitType = E->getType(); - if (const ArrayType *Array = getContext().getAsArrayType(InitType)) + if (Array) InitType = getContext().getBaseElementType(Array); const CXXRecordDecl *RD = cast<CXXRecordDecl>(InitType->getAs<RecordType>()->getDecl()); @@ -609,8 +611,7 @@ CodeGenFunction::EmitCXXConstructExpr(llvm::Value *Dest, EmitAggExpr((*i), Dest, false); return; } - if (const ConstantArrayType *Array = - getContext().getAsConstantArrayType(E->getType())) { + if (Array) { QualType BaseElementTy = getContext().getBaseElementType(Array); const llvm::Type *BasePtr = ConvertType(BaseElementTy); BasePtr = llvm::PointerType::getUnqual(BasePtr); |

