]> granicus.if.org Git - clang/commitdiff
Minor cleanup.
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 28 Oct 2009 21:07:28 +0000 (21:07 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 28 Oct 2009 21:07:28 +0000 (21:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85434 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCXX.cpp

index 345eacb673e1d52eee4d36f063f40a250314557d..818c5162daf705292cb0fe97d3798a0d44ded0ed 100644 (file)
@@ -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);