This is an archive of the discontinued LLVM Phabricator instance.

Fix one-after-the-end type metadata handling in globalsplit
ClosedPublic

Authored by eugenis on Mar 7 2017, 1:38 PM.

Details

Summary

Itanium ABI may have an address point one byte after the end of a
vtable. When such vtable global is split, the !type metadata needs to
follow the right vtable.

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis created this revision.Mar 7 2017, 1:38 PM
pcc edited edge metadata.Mar 7 2017, 1:55 PM

LGTM

This is a bit of a hack because we're assuming that vtable groups are the only kinds of global variables that !type metadata can be attached to, and that they are either Itanium ABI vtable groups or contain a single vtable (i.e. Microsoft ABI vtables). To avoid needing to make that assumption we may want to represent the type metadata offsets as something like a set of GEP indices instead of a byte offset. But this is fine for now. Please leave a comment stating that we're making this assumption.

pcc accepted this revision.Mar 7 2017, 1:55 PM
This revision is now accepted and ready to land.Mar 7 2017, 1:55 PM
eugenis updated this revision to Diff 90935.Mar 7 2017, 2:11 PM
This revision was automatically updated to reflect the committed changes.