[all-commits] [llvm/llvm-project] f0601c: [clang][NFC] Replace TypeAlignment with alignof(T)...

Vlad Serebrennikov via All-commits all-commits at lists.llvm.org
Tue Oct 17 02:05:03 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f0601c7569c6e2001b180136e1b699f577fd5c06
      https://github.com/llvm/llvm-project/commit/f0601c7569c6e2001b180136e1b699f577fd5c06
  Author: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/Sema/SemaType.cpp

  Log Message:
  -----------
  [clang][NFC] Replace TypeAlignment with alignof(T) (#69185)

This patch replaces usages of `TypeAlignment` with `alignof(T)`, where `T` is type that will be created in allocated storage with placement-new. This is now possible, because `alignof` reports the correct alignment for `Type` and classes derived from it after #68377 was merged.

While preparing #68377 I verified via `static_assert` that there are no mismatches of alignment between `TypeAlignment` and alignment of types derived from `Type`, so no changes are expected to codegen.




More information about the All-commits mailing list