-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang] Fix FIXME in isAlignasAttribute()
AttributeCommonInfo::isAlignasAttribute() was used in one place: isCXX11Attribute(). The intention was for isAlignasAttribute() to return true for the C++ alignas keyword. However, as a FIXME noted, the function also returned true for the C _Alignas keyword. This meant that isCXX11Attribute() returned true for _Alignas as well as for alignas. AttributeCommonInfos are now always constructed with an AttributeCommonInfo::Form. We can use that Form to convey whether a keyword is alignas or not. The patch uses 1 bit of an 8-bit hole in the current layout of AttributeCommonInfo. This might not be the best long-term design, but it should be easy to adapt the layout if necessary (that is, if other uses are found for the spare bits). I don't know of a way of testing this (other than grep -c FIXME) Differential Revision: https://reviews.llvm.org/D148105
- Loading branch information
1 parent
aec3f95
commit bd41371
Showing
4 changed files
with
35 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters