[cfe-commits] r77993 - /cfe/trunk/lib/CodeGen/CGDecl.cpp

Fariborz Jahanian fjahanian at apple.com
Mon Aug 3 13:51:43 PDT 2009


Author: fjahanian
Date: Mon Aug  3 15:51:29 2009
New Revision: 77993

URL: http://llvm.org/viewvc/llvm-project?rev=77993&view=rev
Log:
assert(nyi) on attempt to destruct an array of objects.

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

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Mon Aug  3 15:51:29 2009
@@ -433,12 +433,16 @@
   }
 
   // Handle CXX destruction of variables.
-  // FIXME - destruction of arrays NYI.
-  if (const RecordType *RT = Ty->getAs<RecordType>())
+  QualType DtorTy(Ty);
+  if (const ArrayType *Array = DtorTy->getAs<ArrayType>())
+    DtorTy = Array->getElementType();
+  if (const RecordType *RT = DtorTy->getAs<RecordType>())
     if (CXXRecordDecl *ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl())) {
       if (!ClassDecl->hasTrivialDestructor()) {
         const CXXDestructorDecl *D = ClassDecl->getDestructor(getContext());
         assert(D && "EmitLocalBlockVarDecl - destructor is nul");
+        assert(!Ty->getAs<ArrayType>() && "FIXME - destruction of arrays NYI");
+        
         CleanupScope scope(*this);
         EmitCXXDestructorCall(D, Dtor_Complete, DeclPtr);
       }





More information about the cfe-commits mailing list