[all-commits] [llvm/llvm-project] a91916: [AIX] "aligned" attribute should not decrease type...

Steven Wan via All-commits all-commits at lists.llvm.org
Thu Aug 5 15:19:25 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a91916500d67155ca17bfdf3294541f871f90a45
      https://github.com/llvm/llvm-project/commit/a91916500d67155ca17bfdf3294541f871f90a45
  Author: Steven Wan <wanyu9511 at gmail.com>
  Date:   2021-08-05 (Thu, 05 Aug 2021)

  Changed paths:
    M clang/lib/AST/ASTContext.cpp
    A clang/test/Layout/aix-alignof-align-and-pack-attr.cpp

  Log Message:
  -----------
  [AIX] "aligned" attribute should not decrease type alignment returned by __alignof__

`__alignof__(x)` always returns `ABIAlign` if the "x" is marked `__attribute__((aligned()))`. However, the "aligned" attribute should only increase the alignment of a struct, or struct member, unless it's used together with the "packed" attribute, or used as a part of a typedef, in which case, the "aligned" attribute can both increase and decrease alignment.

Reviewed By: sfertile

Differential Revision: https://reviews.llvm.org/D107598




More information about the All-commits mailing list