[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-09-18 Thread Michael Buch via cfe-commits
Michael137 wrote: > This change leads to a crash in `ConstStructBuilder::Build()` for the > following program: > > ``` > struct S { > }; > > union U { > struct S s; > int x; > }; > > void foo() { > union U bar = {}; > } > ``` > > `isEmptyRecordForLayout` returns false for `union

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-09-18 Thread Henrik G. Olsson via cfe-commits
hnrklssn wrote: This change leads to a crash in the following case: ``` struct S { }; union U { struct S s; int x; }; void foo() { union U bar = {}; } ``` `isEmptyRecordForLayout` returns false for `union U` because the recursive call for `U::x` returns false. This means we call `I

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-08-01 Thread Michael Buch via cfe-commits
@@ -137,6 +137,16 @@ bool isEmptyField(ASTContext &Context, const FieldDecl *FD, bool AllowArrays, bool isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays, bool AsIfNoUniqueAddr = false); +/// isEmptyFieldForLayout - Return true iff the field i

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-26 Thread Sergei Barannikov via cfe-commits
@@ -137,6 +137,16 @@ bool isEmptyField(ASTContext &Context, const FieldDecl *FD, bool AllowArrays, bool isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays, bool AsIfNoUniqueAddr = false); +/// isEmptyFieldForLayout - Return true iff the field i

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-15 Thread Michael Buch via cfe-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-15 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From 46d15431cae1123282f4c0856360c9e3ce7322fc Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 01/20] [clang][CGRecordLayout] Remove dependency on isZeroSize

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-12 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From 07e603f7afc98e5af31962a5b1f44f4e4c079ebb Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 01/19] [clang][CGRecordLayout] Remove dependency on isZeroSize

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-11 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-11 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From 07e603f7afc98e5af31962a5b1f44f4e4c079ebb Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 01/16] [clang][CGRecordLayout] Remove dependency on isZeroSize

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-11 Thread Eli Friedman via cfe-commits
@@ -310,6 +310,41 @@ bool CodeGen::isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays, return true; } +bool CodeGen::isEmptyFieldForLayout(const ASTContext &Context, +const FieldDecl *FD) { + if (FD->isZeroLengthBitField(Con

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-11 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From 07e603f7afc98e5af31962a5b1f44f4e4c079ebb Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 01/15] [clang][CGRecordLayout] Remove dependency on isZeroSize

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-11 Thread Michael Buch via cfe-commits
Michael137 wrote: > Some of the libc++ tests seem to be crashing on the x86_64 bot (can repro > locally, on aarch64 too). Looks like they're segfaulting trying to access the > member of an empty class. E.g., in > > ``` > Process 1370440 stopped > * thread #1, name = 't.tmp.exe', stop reason =

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-11 Thread Michael Buch via cfe-commits
Michael137 wrote: Some of the libc++ tests seem to be crashing on the x86_64 bot (can repro this on my x86_64 at home, not aarch64 though). Looks like they're segfaulting trying to access the member of an empty class. E.g., in ``` Process 1370440 stopped * thread #1, name = 't.tmp.exe', stop re

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-10 Thread Eli Friedman via cfe-commits
@@ -1,7 +1,19 @@ -// RUN: %clang_cc1 -emit-llvm < %s | grep "zeroinitializer, i16 16877" +// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefixes=CHECK,EMPTY +// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-windows-msvc -o - | FileCheck %s

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-10 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-10 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-10 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-10 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-10 Thread Michael Buch via cfe-commits
@@ -1,7 +1,19 @@ -// RUN: %clang_cc1 -emit-llvm < %s | grep "zeroinitializer, i16 16877" +// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefixes=CHECK,EMPTY +// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-windows-msvc -o - | FileCheck %s

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-10 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From 07e603f7afc98e5af31962a5b1f44f4e4c079ebb Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 01/13] [clang][CGRecordLayout] Remove dependency on isZeroSize

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From 07e603f7afc98e5af31962a5b1f44f4e4c079ebb Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 01/12] [clang][CGRecordLayout] Remove dependency on isZeroSize

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
@@ -1,7 +1,17 @@ -// RUN: %clang_cc1 -emit-llvm < %s | grep "zeroinitializer, i16 16877" +// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s // PR4390 struct sysfs_dirent { - union { struct sysfs_elem_dir {} s_dir; }; + union { struct sysfs_elem_dir { int x; } s_dir; }; unsi

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From 07e603f7afc98e5af31962a5b1f44f4e4c079ebb Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 01/11] [clang][CGRecordLayout] Remove dependency on isZeroSize

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
@@ -185,6 +203,18 @@ CALL_AO(PackedMembers) // CHECK: call void @llvm.memcpy.p0.p0.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret ptr +// WithEmptyField copy-assignment: +// CHECK-LABEL: define linkonce_odr nonnull align {{[0-9]+}} dereferenceable({

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Eli Friedman via cfe-commits
@@ -185,6 +203,18 @@ CALL_AO(PackedMembers) // CHECK: call void @llvm.memcpy.p0.p0.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret ptr +// WithEmptyField copy-assignment: +// CHECK-LABEL: define linkonce_odr nonnull align {{[0-9]+}} dereferenceable({

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Eli Friedman via cfe-commits
@@ -1,7 +1,17 @@ -// RUN: %clang_cc1 -emit-llvm < %s | grep "zeroinitializer, i16 16877" +// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s // PR4390 struct sysfs_dirent { - union { struct sysfs_elem_dir {} s_dir; }; + union { struct sysfs_elem_dir { int x; } s_dir; }; unsi

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Eli Friedman via cfe-commits
@@ -137,6 +137,16 @@ bool isEmptyField(ASTContext &Context, const FieldDecl *FD, bool AllowArrays, bool isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays, bool AsIfNoUniqueAddr = false); +/// isEmptyFieldForLayout - Return true iff the field i

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Reid Kleckner via cfe-commits
@@ -185,6 +203,18 @@ CALL_AO(PackedMembers) // CHECK: call void @llvm.memcpy.p0.p0.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret ptr +// WithEmptyField copy-assignment: +// CHECK-LABEL: define linkonce_odr nonnull align {{[0-9]+}} dereferenceable({

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread David Blaikie via cfe-commits
@@ -185,6 +203,18 @@ CALL_AO(PackedMembers) // CHECK: call void @llvm.memcpy.p0.p0.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret ptr +// WithEmptyField copy-assignment: +// CHECK-LABEL: define linkonce_odr nonnull align {{[0-9]+}} dereferenceable({

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
@@ -185,6 +203,18 @@ CALL_AO(PackedMembers) // CHECK: call void @llvm.memcpy.p0.p0.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret ptr +// WithEmptyField copy-assignment: +// CHECK-LABEL: define linkonce_odr nonnull align {{[0-9]+}} dereferenceable({

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
Michael137 wrote: > I wouldn't be surprised if there's missing coverage here. Added a test for the `memcpy` part in the latest commit. https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From 07e603f7afc98e5af31962a5b1f44f4e4c079ebb Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 01/10] [clang][CGRecordLayout] Remove dependency on isZeroSize

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
Michael137 wrote: > > > For CGClass, it's not directly tied to the LLVM structure layout, but I'm > > > not sure the generated code would be semantically correct if an "empty" > > > field that isn't isEmpty() overlaps with actual data. > > > > > > I haven't addressed this yet. To clarify, are

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From 07e603f7afc98e5af31962a5b1f44f4e4c079ebb Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 1/9] [clang][CGRecordLayout] Remove dependency on isZeroSize Th

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-08 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: It looks like in the latest patch, there's still a couple uses of isZeroSize() in CGExprConstant? https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-08 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > > For CGClass, it's not directly tied to the LLVM structure layout, but I'm > > not sure the generated code would be semantically correct if an "empty" > > field that isn't isEmpty() overlaps with actual data. > > I haven't addressed this yet. To clarify, are you referri

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-05 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From 7fb44b1cd3ffac0a0f509cefa3a141dac50da142 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 1/8] [clang][CGRecordLayout] Remove dependency on isZeroSize Th

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-05 Thread Michael Buch via cfe-commits
Michael137 wrote: Had to adjust `isEmptyFieldForLayout`/`isEmptyRecordForLayout` because `isEmptyField`/`isEmptyRecord` would call each other recursively, so dispatching from `isEmptyFieldForLayout` wouldn't have been correct (since the `isEmptyField`/`isEmptyRecord` have extra checks for unna

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-02 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. I think this looks good, then. Any other concerns? https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-01 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From 419af1b1db2bef88c5145276ffd24ed93bcb15a5 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 1/7] [clang][CGRecordLayout] Remove dependency on isZeroSize Th

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-29 Thread Michael Buch via cfe-commits
Michael137 wrote: > For CGExprConstant, the code is checking "empty" in the sense of whether > there's a corresponding LLVM field. So almost certainly needs changes. Not > sure how that isn't causing test failures; maybe there's missing test > coverage. Yea I was pretty sure we'd have to adju

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-25 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: For CGExprConstant, the code is checking "empty" in the sense of whether there's a corresponding LLVM field. So almost certainly needs changes. Not sure how that isn't causing test failures; maybe there's missing test coverage. For CGClass, it's not directly tied to the

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-25 Thread John McCall via cfe-commits
rjmccall wrote: That sounds fine to me as long as we're still emitting projections of them properly (i.e. not just assuming "oh, it's an empty record, we can use whatever pointer we want because it'll never be dereferenced"). https://github.com/llvm/llvm-project/pull/96422

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-25 Thread Reid Kleckner via cfe-commits
rnk wrote: IIUC, this effectively removes all empty records from LLVM struct types. This makes the IR less "pretty", but these subobjects are notionally empty and consist of only padding bytes (i8 and i8 arrays) at the end of the day. I think that's acceptable. + @rjmccall , does that sound go

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Michael Buch (Michael137) Changes This is a follow-up from the conversation starting at https://github.com/llvm/llvm-project/pull/93809#issuecomment-2173729801 The root problem that motivated the change are external AST sources th

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-25 Thread Michael Buch via cfe-commits
https://github.com/Michael137 ready_for_review https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-25 Thread Michael Buch via cfe-commits
Michael137 wrote: > (Please move out of "draft" when you think this is ready.) Updated the PR with some more context. There's still a few instances of `FieldDecl::isZeroSize`/`CXXRecordDecl::isEmpty` around `CodeGen` (see `CGClass`, `CGExprConstant`), but it wasn't obvious to me whether those

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-25 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-25 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-24 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: (Please move out of "draft" when you think this is ready.) https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-24 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: This is roughly what I expected the patch to look like. Maybe consider adding a couple small wrapper functions around isEmptyRecord/isEmptyField to simplify the uses (and so we can use a name that indicates why the checks exist). https://github.com/llvm/llvm-project/pull/

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-24 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From f5938919b3a0060db6b373bead1c52f4bb65c841 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 1/4] [clang][CGRecordLayout] Remove dependency on isZeroSize Th

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-24 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From f5938919b3a0060db6b373bead1c52f4bb65c841 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 1/4] [clang][CGRecordLayout] Remove dependency on isZeroSize Th

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-24 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From f5938919b3a0060db6b373bead1c52f4bb65c841 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 1/4] [clang][CGRecordLayout] Remove dependency on isZeroSize Th

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-24 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From f5938919b3a0060db6b373bead1c52f4bb65c841 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 1/4] [clang][CGRecordLayout] Remove dependency on isZeroSize Th

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-23 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From f5938919b3a0060db6b373bead1c52f4bb65c841 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 1/3] [clang][CGRecordLayout] Remove dependency on isZeroSize Th

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-23 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/96422 >From f5938919b3a0060db6b373bead1c52f4bb65c841 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 21 Jun 2024 12:15:07 +0100 Subject: [PATCH 1/2] [clang][CGRecordLayout] Remove dependency on isZeroSize Th

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-23 Thread Michael Buch via cfe-commits
Michael137 wrote: In draft for now because I'm still wrapping my head around some of the IR implications of this. Some of them seem suspect. https://github.com/llvm/llvm-project/pull/96422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-06-23 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/96422 This is a follow-up from the conversation starting at https://github.com/llvm/llvm-project/pull/93809#issuecomment-2173729801 The root problem that motivated the change are external AST sources that compute