This is an archive of the discontinued LLVM Phabricator instance.

Remove MSVC workaround for AlignedCharArray (NFC)
ClosedPublic

Authored by mehdi_amini on Dec 1 2016, 11:24 AM.

Event Timeline

mehdi_amini retitled this revision from to Remove MSVC workaround for AlignedCharArray (NFC).
mehdi_amini updated this object.
mehdi_amini added reviewers: zturner, rnk.
mehdi_amini added a subscriber: llvm-commits.

(If someone can confirm it works on the current MSVC 2015)

I tried this recently and it still doesn't work (rL284738)

Thanks bkramer! Let's just improve the comment then?

bkramer accepted this revision.Dec 1 2016, 12:58 PM
bkramer added a reviewer: bkramer.

Thanks! And sorry for missing this in my revert.

This revision is now accepted and ready to land.Dec 1 2016, 12:58 PM
This revision was automatically updated to reflect the committed changes.
rnk edited edge metadata.Dec 6 2016, 11:22 AM

This whole type is basically a lie, though. 32-bit MSVC only ever aligns objects passed by value to 4 bytes. MSVC will issue an error if you try to pass something with __declspec(align) by value. This ifdef effectively works around that diagnostic, but fails to accomplish the goal of alignment.

If we ever depend on the alignment of these objects when they are passed by value, we are screwed. The only thing that saves us today is that we don't often pass highly aligned things by value.

So, there is more work to do here.