summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-08-03 20:51:29 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-08-03 20:51:29 +0000
commitd44bdb29263429a47be472ca9db6260f5deb66b9 (patch)
treec064d3ed4debe0c9a112ad83d04632e15ee0dbd2 /clang/lib/CodeGen
parentf307e0bd6d1d620c2b2b56cebd731f02e582c67c (diff)
downloadbcm5719-llvm-d44bdb29263429a47be472ca9db6260f5deb66b9.tar.gz
bcm5719-llvm-d44bdb29263429a47be472ca9db6260f5deb66b9.zip
assert(nyi) on attempt to destruct an array of objects.
llvm-svn: 77993
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 347a0af6968..bda3cf7e6f0 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -433,12 +433,16 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
}
// 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);
}
OpenPOWER on IntegriCloud