[cfe-commits] r85434 - /cfe/trunk/lib/CodeGen/CGCXX.cpp

Fariborz Jahanian fjahanian at apple.com
Wed Oct 28 14:07:28 PDT 2009


Author: fjahanian
Date: Wed Oct 28 16:07:28 2009
New Revision: 85434

URL: http://llvm.org/viewvc/llvm-project?rev=85434&view=rev
Log:
Minor cleanup.


Modified:
    cfe/trunk/lib/CodeGen/CGCXX.cpp

Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=85434&r1=85433&r2=85434&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Wed Oct 28 16:07:28 2009
@@ -591,11 +591,13 @@
                                       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 @@
     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);





More information about the cfe-commits mailing list