This is an archive of the discontinued LLVM Phabricator instance.

[MS] Fix for bug 25013 - #pragma vtordisp is unknown inside functions.
ClosedPublic

Authored by d.zobnin.bugzilla on Nov 6 2015, 3:25 PM.

Details

Summary

This patch adds support of #pragma vtordisp inside functions in attempt to improve compatibility. Microsoft compiler appears to save the stack of vtordisp modes on entry of struct methods' bodies and restore it on exit (method-local vtordisp).

Diff Detail

Repository
rL LLVM

Event Timeline

d.zobnin.bugzilla retitled this revision from to [MS] Fix for bug 25013 - #pragma vtordisp is unknown inside functions..
d.zobnin.bugzilla updated this object.
d.zobnin.bugzilla added a reviewer: rnk.
d.zobnin.bugzilla added a subscriber: cfe-commits.
rnk accepted this revision.Nov 12 2015, 3:59 PM
rnk edited edge metadata.

I went ahead and ran some of your test cases through MSVC, and I agree with your results. This is pretty interesting behavior. Thanks for looking into it! Looks good.

test/SemaCXX/pragma-vtordisp.cpp
35–37 ↗(On Diff #39602)

With your changes, can we enable this test?

This revision is now accepted and ready to land.Nov 12 2015, 3:59 PM
d.zobnin.bugzilla edited edge metadata.

Only tests have been updated: enabled a test case for Sema, which pass with these changes, added corresponding test case for CodeGen.

test/SemaCXX/pragma-vtordisp.cpp
34–35 ↗(On Diff #40380)

Yes, we can. Enabled this case, it passes with these changes.

This revision was automatically updated to reflect the committed changes.