This is an archive of the discontinued LLVM Phabricator instance.

[MS ABI] Never reference dllimport'd vtables
ClosedPublic

Authored by majnemer on Feb 9 2016, 5:01 PM.

Details

Summary

Referencing a dllimported vtable is impossible in a constexpr
constructor. It would be friendlier to C++ programmers if we
synthesized a copy of the vftable which referenced imported virtual
functions. This would let us initialize the object in a way which
preserves both the intent to import functionality from another DLL while
also making constexpr work.

Diff Detail

Event Timeline

majnemer updated this revision to Diff 47407.Feb 9 2016, 5:01 PM
majnemer retitled this revision from to [MS ABI] Never reference dllimport'd vtables.
majnemer updated this object.
majnemer added reviewers: rnk, hans, thakis, rsmith.
majnemer added a subscriber: cfe-commits.
rnk accepted this revision.Feb 9 2016, 5:07 PM
rnk edited edge metadata.

lgtm if you clarify that bit

lib/CodeGen/MicrosoftCXXABI.cpp
1676

According to you, this is a crazy special case, add comments. :)

This revision is now accepted and ready to land.Feb 9 2016, 5:07 PM
This revision was automatically updated to reflect the committed changes.