[PATCH] D23325: [WIP] Binding of references to packed fields

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 30 14:35:02 PDT 2016


aaron.ballman added inline comments.

================
Comment at: include/clang/AST/Expr.h:436
@@ -434,1 +435,3 @@
 
+  /// \brief Returns true if this expression is a gl-value that
+  /// potentially refers to a packed-field. Here packed-field means
----------------
s/gl-value/glvalue


================
Comment at: include/clang/AST/Expr.h:438
@@ +437,3 @@
+  /// potentially refers to a packed-field. Here packed-field means
+  /// that the field has got its alignment effectively reduced.
+  ///
----------------
"that the field has an effectively-reduced alignment"

================
Comment at: include/clang/AST/Expr.h:440
@@ +439,3 @@
+  ///
+  /// Likewise bitfields, we model gl-values referring to packed-fields as
+  /// an aspect of the value-kind type system.
----------------
Like bitfields
glvalues

================
Comment at: include/clang/AST/Stmt.h:135
@@ -134,3 +134,3 @@
   };
-  enum { NumExprBits = 16 };
+  enum { NumExprBits = 17 };
 
----------------
This is a bit unfortunate (not that I see a way around it)...

================
Comment at: lib/AST/ASTDumper.cpp:1878
@@ +1877,3 @@
+    case OK_PackedField:
+      OS << " packfield";
+      break;
----------------
packedfield instead?

================
Comment at: lib/AST/Decl.cpp:37
@@ -36,1 +36,3 @@
 
+#include <iostream>
+
----------------
This should be removed.

================
Comment at: lib/Sema/SemaExprMember.cpp:1779
@@ +1778,3 @@
+  if (VK != VK_RValue)
+  {
+    if (Field->isBitField())
----------------
Formatting of the brace is incorrect.

================
Comment at: lib/Sema/SemaInit.cpp:4188
@@ +4187,3 @@
+        Initializer->getType()->getAsCXXRecordDecl()) {
+      auto Record = Initializer->getType()->getAsCXXRecordDecl();
+      /*
----------------
I don't know whether you should use `auto` here or not, the type is kinda-sorta spelled out in the initialization. At the very least, this should be `const auto *`.


https://reviews.llvm.org/D23325





More information about the cfe-commits mailing list