Page MenuHomePhabricator

[CodeGen] Set construction vtable visibility after creating initializer
ClosedPublic

Authored by phosek on Feb 9 2019, 7:50 PM.

Details

Summary

We must only set the construction vtable visibility after we create the
vtable initializer, otherwise the global value will be treated as
declaration rather than definition and the visibility won't be set.

Diff Detail

Repository
rL LLVM

Event Timeline

phosek created this revision.Feb 9 2019, 7:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2019, 7:50 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
phosek retitled this revision from [CodeGen] Set construction vtable visibility after creating initialize to [CodeGen] Set construction vtable visibility after creating initializer.Feb 9 2019, 7:50 PM
mcgrathr accepted this revision.Feb 9 2019, 7:55 PM
mcgrathr added a subscriber: mcgrathr.

lgtm with a comment (and perhaps an assertion).

clang/lib/CodeGen/CGVTables.cpp
777 ↗(On Diff #186141)

Give it a comment pointing out the importance of doing this after createVTableInitializer rather than before.
If there's an easy way to add an "assert(is defined)" before setGVProperties to go with the comment, do that too.

This revision is now accepted and ready to land.Feb 9 2019, 7:55 PM
phosek updated this revision to Diff 186142.Feb 9 2019, 8:08 PM
phosek marked an inline comment as done.
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2019, 12:13 PM