[PATCH] D53207: Fix bug 26547 - alignof should return ABI alignment, not preferred alignment

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 24 14:37:34 PDT 2018


rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

Thanks! Can you also write something for the release notes (docs/ReleaseNotes.rst) describing the ABI change?



================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:5478
 def ext_sizeof_alignof_function_type : Extension<
-  "invalid application of '%select{sizeof|alignof|vec_step}0' to a "
+  "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align|__alignof}0' to a "
   "function type">, InGroup<PointerArith>;
----------------
Please factor out this repeated %select and use a %sub instead.


================
Comment at: lib/Sema/SemaExpr.cpp:3772
   //   is the alignment of the element type.
-  if (ExprKind == UETT_AlignOf || ExprKind == UETT_OpenMPRequiredSimdAlign)
+  if (ExprKind == UETT_AlignOf || ExprKind == UETT_PreferredAlignOf || ExprKind == UETT_OpenMPRequiredSimdAlign)
     ExprType = Context.getBaseElementType(ExprType);
----------------
Please reflow this to under 80 columns.


Repository:
  rC Clang

https://reviews.llvm.org/D53207





More information about the cfe-commits mailing list