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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user