This is an archive of the discontinued LLVM Phabricator instance.

[MSVC] Support of __unaligned qualifier for function types
ClosedPublic

Authored by andreybokhanko on May 19 2016, 8:33 AM.

Details

Summary

This adds support of MS-specific "__unaligned" qualifier for function types and fixes errors described by David Majnemer in this thread: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160509/thread.html#158098

Yours,

Andrey

Software Engineer
Intel Compiler Team

Diff Detail

Event Timeline

andreybokhanko retitled this revision from to [MSVC] Support of __unaligned qualifier for function types.
andreybokhanko updated this object.
andreybokhanko added reviewers: rnk, majnemer.
andreybokhanko added a subscriber: cfe-commits.
majnemer added inline comments.May 19 2016, 8:52 AM
include/clang/Sema/DeclSpec.h
1152–1169

Should __unaligned actually be carried here or does MSVC discard the qualifier here?

1414–1418

Ditto. Do we need storage for this bit or should we make sure it got discarded earlier?

Added a test for __unaligned arrays.

andreybokhanko marked 2 inline comments as done.May 20 2016, 1:52 AM
andreybokhanko added inline comments.
include/clang/Sema/DeclSpec.h
1152–1169

Yes, MSVC does carry __unaligned in arrays. I added a test to MicrosoftExtensions.cpp.

1414–1418

The same. A test already exists in MicrosoftExtensions.cpp (line 121).

majnemer accepted this revision.May 25 2016, 9:05 AM
majnemer edited edge metadata.

LGTM

lib/Sema/SemaExprCXX.cpp
937

Can you add a comment for this line.

This revision is now accepted and ready to land.May 25 2016, 9:05 AM
andreybokhanko marked 3 inline comments as done.May 26 2016, 2:46 AM
andreybokhanko added inline comments.
lib/Sema/SemaExprCXX.cpp
937

Done.

Thank you for the review!

This revision was automatically updated to reflect the committed changes.