[all-commits] [llvm/llvm-project] 7a48c2: [CIR] Represent 'empty' fields in structs/unions (...
Erich Keane via All-commits
all-commits at lists.llvm.org
Thu Jul 9 08:44:59 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7a48c2cb8e505c53e50a74642b0b129303163c6f
https://github.com/llvm/llvm-project/commit/7a48c2cb8e505c53e50a74642b0b129303163c6f
Author: Erich Keane <ekeane at nvidia.com>
Date: 2026-07-09 (Thu, 09 Jul 2026)
Changed paths:
M clang/include/clang/CIR/MissingFeatures.h
M clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
M clang/lib/CIR/CodeGen/CIRGenModule.cpp
M clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
M clang/test/CIR/CodeGen/cross-reference-globals.c
M clang/test/CIR/CodeGen/paren-list-agg-init.cpp
A clang/test/CIR/CodeGen/pointer-to-empty-data-member.cpp
Log Message:
-----------
[CIR] Represent 'empty' fields in structs/unions (#207033)
Since we do field based GEPs, it isn't really possible to do a
get-address-of a field without representing all the fields in a CIR
struct. This patch makes sure we do that, so we can do the proper GEPs.
This patch also as a drive-by fixes the case where we were searching for
the 'path' inside of an empty base, which we don't represent (and
probably should not need to?).
This patch ALSO adds some NYI diagnostics for cases where we try to get
the address of a `no-unique-address` field, which we are not currently
representing. In the future, we are going to have to start representing
no-unique-address fields inside of a struct as well (plus figure out how
to lower it properly in a way that gets the offsets right), but it isn't
clear this is immediately necessary (as you'd have to take an address of
one to notice?).
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