[all-commits] [llvm/llvm-project] 59de68: [CIR] Verify record_align is a non-zero power of t...

Adam Smith via All-commits all-commits at lists.llvm.org
Wed Aug 5 07:15:10 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 59de680df96e8ed4c283b792b9c1f77d05d071b2
      https://github.com/llvm/llvm-project/commit/59de680df96e8ed4c283b792b9c1f77d05d071b2
  Author: Adam Smith <adams at nvidia.com>
  Date:   2026-08-05 (Wed, 05 Aug 2026)

  Changed paths:
    M clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
    A clang/test/CIR/IR/invalid-record-layout.cir

  Log Message:
  -----------
  [CIR] Verify record_align is a non-zero power of two (#214074)

`#cir.record_layout` carries `record_align`, which CIRGen fills from
`ASTRecordLayout::getAlignment()` and consumers read as an
`llvm::Align`. That constructor asserts the value is a non-zero power of
two, so hand-written CIR naming any other alignment aborted the tool
rather than reporting a parse error. A zero tripped the non-zero assert
and a 3 tripped the power-of-two one, both inside `llvm::Align` with no
indication of which attribute was at fault.

Verify the field where it is parsed. Values CIRGen emits are already
well-formed, so this only affects hand-written input.

Assisted-by: Cursor / claude-opus-5



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list