[all-commits] [llvm/llvm-project] 5bfc17: [CIR] Accept a union whose empty member is [[no_un...

Adam Smith via All-commits all-commits at lists.llvm.org
Mon Sep 14 14:39:39 PDT 2026


  Branch: refs/heads/users/adams381/cir-callconv-union-nua-empty
  Home:   https://github.com/llvm/llvm-project
  Commit: 5bfc1766d303d67eb12cc95d980dd8b7039144d6
      https://github.com/llvm/llvm-project/commit/5bfc1766d303d67eb12cc95d980dd8b7039144d6
  Author: Adam Smith <adams at nvidia.com>
  Date:   2026-09-14 (Mon, 14 Sep 2026)

  Changed paths:
    M clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
    M clang/test/CIR/CodeGen/call-conv-lowering-x86_64-empty.cpp
    M clang/test/CIR/Transforms/abi-lowering/x86_64-aggregate-nyi.cir
    M clang/test/CIR/Transforms/abi-lowering/x86_64-union.cir

  Log Message:
  -----------
  [CIR] Accept a union whose empty member is [[no_unique_address]]

The record-wide reject for a member CIRGen marks empty is there for the
struct arm of mapCIRType, which reads such a member as an unnamed
bit-field standing for the bytes it occupies.  This does not apply to a
union, so the reject moves into the struct branch.

Which variants the classifier sees then falls to the union arm, and it
now reads that from each variant's own storage rather than from its
mark.  A zero-sized variant and one that is empty for the ABI are
skipped.  One whose mark says empty over storage that holds data is not.

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