This is an archive of the discontinued LLVM Phabricator instance.

MS ABI: Don't assert when generating virtual function call with virtual bases and -flto (PR30731)
ClosedPublic

Authored by hans on Oct 19 2016, 10:51 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

hans updated this revision to Diff 75171.Oct 19 2016, 10:51 AM
hans retitled this revision from to MS ABI: Don't assert when generating virtual function call with virtual bases and -flto (PR30731).
hans updated this object.
hans added a reviewer: pcc.
hans added a subscriber: cfe-commits.
pcc accepted this revision.Oct 19 2016, 10:58 AM
pcc edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 19 2016, 10:58 AM
This revision was automatically updated to reflect the committed changes.

Why did this only fail with -flto? Seems strange.

hans added a comment.Oct 19 2016, 12:48 PM

Why did this only fail with -flto? Seems strange.

I was asking myself the same thing :-) It's because of this code in MicrosoftCXXABI::getVirtualFunctionPointer:

if (CGM.getCodeGenOpts().PrepareForLTO) // XXX: Aha!
  CGF.EmitTypeMetadataCodeForVCall(
      getClassAtVTableLocation(getContext(), GD, ML), VTable, Loc);