[PATCH] D20437: [MSVC] Support of __unaligned qualifier for function types

David Majnemer via cfe-commits cfe-commits at lists.llvm.org
Thu May 19 08:52:50 PDT 2016


majnemer added inline comments.

================
Comment at: include/clang/Sema/DeclSpec.h:1152-1169
@@ -1153,19 +1151,20 @@
 
   struct ArrayTypeInfo : TypeInfoCommon {
-    /// The type qualifiers for the array: const/volatile/restrict/_Atomic.
-    unsigned TypeQuals : 4;
+    /// The type qualifiers for the array:
+    /// const/volatile/restrict/__unaligned/_Atomic.
+    unsigned TypeQuals : 5;
 
     /// True if this dimension included the 'static' keyword.
     bool hasStatic : 1;
 
     /// True if this dimension was [*].  In this case, NumElts is null.
     bool isStar : 1;
 
     /// This is the size of the array, or null if [] or [*] was specified.
     /// Since the parser is multi-purpose, and we don't want to impose a root
     /// expression class on all clients, NumElts is untyped.
     Expr *NumElts;
 
     void destroy() {}
   };
 
----------------
Should `__unaligned` actually be carried here or does MSVC discard the qualifier here?

================
Comment at: include/clang/Sema/DeclSpec.h:1414-1418
@@ -1414,7 +1413,7 @@
 
   struct MemberPointerTypeInfo : TypeInfoCommon {
-    /// The type qualifiers: const/volatile/restrict/_Atomic.
-    unsigned TypeQuals : 4;
+    /// The type qualifiers: const/volatile/restrict/__unaligned/_Atomic.
+    unsigned TypeQuals : 5;
     // CXXScopeSpec has a constructor, so it can't be a direct member.
     // So we need some pointer-aligned storage and a bit of trickery.
     union {
----------------
Ditto.  Do we need storage for this bit or should we make sure it got discarded earlier?


http://reviews.llvm.org/D20437





More information about the cfe-commits mailing list