This is an archive of the discontinued LLVM Phabricator instance.

[ms-cxxabi] Add basic support for vector deleting destructors.
Needs ReviewPublic

Authored by pcc on May 19 2013, 3:26 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

These destructors are used by cl.exe to implement polymorphic delete[],
a language extension which we don't support (yet). However, we
are forced by the ABI to implement some support for them. This is
because cl.exe, when compiling delete[] with a parameter of pointer to
dynamic class type, will emit a call to the vector deleting destructor
via the vftable. Unless we implement the correct semantics for this
destructor, the wrong number of objects will be deleted and the wrong
memory address will be freed.

To begin with, place a reference to the vector deleting dtor in the
vtable (instead of the scalar deleting dtor), and emit the vector
deleting dtor as a weak alias of the scalar deleting dtor. This is
what cl.exe does when the TU does not contain a new[] expression for
that class type. We don't actually emit the definition of the vector
deleting dtor yet, that will be done in a later change.

Diff Detail

Event Timeline

timurrrr resigned from this revision.Mar 26 2015, 9:28 AM
timurrrr removed a reviewer: timurrrr.

Out of date?