diff options
author | John McCall <rjmccall@apple.com> | 2011-07-09 01:37:26 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-07-09 01:37:26 +0000 |
commit | 82fe67bb827655aae994e58c4ae0a98be42c94d6 (patch) | |
tree | 013d674226caf70164ca609f5ff18e8a2bbd669f /clang/lib/CodeGen/CGClass.cpp | |
parent | f023519770be3f94900c0d7e75cf89c7a63b8859 (diff) | |
download | bcm5719-llvm-82fe67bb827655aae994e58c4ae0a98be42c94d6.tar.gz bcm5719-llvm-82fe67bb827655aae994e58c4ae0a98be42c94d6.zip |
A number of array-related IR-gen cleanups.
- Emit default-initialization of arrays that were partially initialized
with initializer lists with a loop, rather than emitting the default
initializer N times;
- support destroying VLAs of non-trivial type, although this is not
yet exposed to users; and
- support the partial destruction of arrays initialized with
initializer lists when an initializer throws an exception.
llvm-svn: 134784
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index 313ee57f7ff..911dbf782f3 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -1172,6 +1172,17 @@ CodeGenFunction::EmitCXXAggrConstructorCall(const CXXConstructorDecl *D, EmitBlock(AfterFor, true); } +void CodeGenFunction::destroyCXXObject(CodeGenFunction &CGF, + llvm::Value *addr, + QualType type) { + const RecordType *rtype = type->castAs<RecordType>(); + const CXXRecordDecl *record = cast<CXXRecordDecl>(rtype->getDecl()); + const CXXDestructorDecl *dtor = record->getDestructor(); + assert(!dtor->isTrivial()); + CGF.EmitCXXDestructorCall(dtor, Dtor_Complete, /*for vbase*/ false, + addr); +} + /// EmitCXXAggrDestructorCall - calls the default destructor on array /// elements in reverse order of construction. void |