This is an archive of the discontinued LLVM Phabricator instance.

Check that Symbol types are trivially destructible
ClosedPublic

Authored by sbc100 on Feb 13 2018, 9:21 AM.

Details

Summary

This adds an extra level of static safety to our use of placement
new to allocate Symbol types. It prevents the accidental addition
of a non-trivially-destructible member that could (for example)
allocate and leak memory.

From the spec: Storage occupied by trivially destructible objects
may be reused without calling the destructor.

Event Timeline

sbc100 created this revision.Feb 13 2018, 9:21 AM
sbc100 retitled this revision from Check that Symbol types are trvially destructible This adds an extra level of static safety to our use of placement new to allocate Symbol types. It prevents the accidental addition on a non-trivially-destructible member that could allocate and... to Check that Symbol types are trvially destructible.Feb 13 2018, 9:22 AM
sbc100 edited the summary of this revision. (Show Details)
sbc100 retitled this revision from Check that Symbol types are trvially destructible to Check that Symbol types are trivially destructible.
sbc100 added reviewers: ruiu, ncw.
sbc100 edited the summary of this revision. (Show Details)Feb 13 2018, 9:22 AM
ruiu accepted this revision.Feb 13 2018, 9:26 AM

LGTM

Thanks! We should've done that from the beginning.

This revision is now accepted and ready to land.Feb 13 2018, 9:26 AM
This revision was automatically updated to reflect the committed changes.