bwendling wrote:
@tstellar PR https://github.com/llvm/llvm-project/pull/90118 is the fix here.
https://github.com/llvm/llvm-project/pull/89126
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c
@@ -826,29 +826,32 @@ const FieldDecl
*CodeGenFunction::FindFlexibleArrayMemberField(
ASTContext &Ctx, const RecordDecl *RD, StringRef Name, uint64_t &Offset) {
const LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel =
getLangOpts().getStrictFlexArraysLe
@@ -826,29 +826,32 @@ const FieldDecl
*CodeGenFunction::FindFlexibleArrayMemberField(
ASTContext &Ctx, const RecordDecl *RD, StringRef Name, uint64_t &Offset) {
const LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel =
getLangOpts().getStrictFlexArraysLe
https://github.com/bwendling closed
https://github.com/llvm/llvm-project/pull/89126
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/89126
>From 36ddb5811f11a1f6968705005713f34713026dbb Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 17 Apr 2024 12:23:02 -0700
Subject: [PATCH 1/8] [Clang] Handle structs with inner structs and no fields
A
https://github.com/efriedma-quic approved this pull request.
LGTM
Please don't forget to fix CountCountedByAttrs... but it's fine if it's in a
followup.
https://github.com/llvm/llvm-project/pull/89126
___
cfe-commits mailing list
cfe-commits@lists.ll
https://github.com/bwendling edited
https://github.com/llvm/llvm-project/pull/89126
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,22 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O2
-Wno-missing-declarations -emit-llvm -o - %s | FileCheck %s
+
+struct foo {
+ struct bar {
+int cou
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/89126
>From 36ddb5811f11a1f6968705005713f34713026dbb Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 17 Apr 2024 12:23:02 -0700
Subject: [PATCH 1/8] [Clang] Handle structs with inner structs and no fields
A
@@ -0,0 +1,40 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O2
-Wno-missing-declarations -emit-llvm -o - %s | FileCheck %s
+
+struct foo {
+ int x,y,z;
+ struct bar
@@ -0,0 +1,40 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O2
-Wno-missing-declarations -emit-llvm -o - %s | FileCheck %s
+
+struct foo {
+ int x,y,z;
+ struct bar
@@ -0,0 +1,22 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O2
-Wno-missing-declarations -emit-llvm -o - %s | FileCheck %s
+
+struct foo {
+ struct bar {
+int cou
@@ -0,0 +1,22 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O2
-Wno-missing-declarations -emit-llvm -o - %s | FileCheck %s
+
+struct foo {
+ struct bar {
+int cou
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/89126
>From 36ddb5811f11a1f6968705005713f34713026dbb Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 17 Apr 2024 12:23:02 -0700
Subject: [PATCH 1/4] [Clang] Handle structs with inner structs and no fields
A
bwendling wrote:
> We should probably apply the same fix to CountCountedByAttrs.
>
> Along those lines, we should be able to handle:
>
> ```
> struct bar {
> int count;
> int array[] __attribute__((counted_by(count)));
> };
> struct foo { struct bar x; };
> void init(void * __attribute__((p
@@ -826,29 +826,31 @@ const FieldDecl
*CodeGenFunction::FindFlexibleArrayMemberField(
ASTContext &Ctx, const RecordDecl *RD, StringRef Name, uint64_t &Offset) {
const LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel =
getLangOpts().getStrictFlexArraysLe
https://github.com/efriedma-quic commented:
We should probably apply the same fix to CountCountedByAttrs.
Along those lines, we should be able to handle:
```
struct bar {
int count;
int array[] __attribute__((counted_by(count)));
};
struct foo { struct bar x; };
void init(void * __attribute
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/89126
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,22 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O2
-Wno-missing-declarations -emit-llvm -o - %s | FileCheck %s
+
+struct foo {
+ struct bar {
+int cou
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/89126
>From 36ddb5811f11a1f6968705005713f34713026dbb Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 17 Apr 2024 12:23:02 -0700
Subject: [PATCH 1/3] [Clang] Handle structs with inner structs and no fields
A
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/89126
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -844,7 +847,18 @@ const FieldDecl
*CodeGenFunction::FindFlexibleArrayMemberField(
if (const FieldDecl *Field =
efriedma-quic wrote:
> if there's an inner struct that's not accessible, that doesn't affect the
> offsets of fields outside of that inner
@@ -844,7 +847,18 @@ const FieldDecl
*CodeGenFunction::FindFlexibleArrayMemberField(
if (const FieldDecl *Field =
bwendling wrote:
I did several tests, and it looks like if there's an inner struct that's not
accessible, that doesn't affect the offsets of
@@ -844,7 +847,18 @@ const FieldDecl
*CodeGenFunction::FindFlexibleArrayMemberField(
if (const FieldDecl *Field =
bwendling wrote:
> FieldNo and Layout are referring to fields of "RD"; the "Field" found in the
> recursive visit is a member of Record (or
@@ -844,7 +847,18 @@ const FieldDecl
*CodeGenFunction::FindFlexibleArrayMemberField(
if (const FieldDecl *Field =
efriedma-quic wrote:
Maybe instead of looking for RecordDecls, this code should be looking for
fields where the type of the field is an anon
@@ -844,7 +847,18 @@ const FieldDecl
*CodeGenFunction::FindFlexibleArrayMemberField(
if (const FieldDecl *Field =
efriedma-quic wrote:
FieldNo and Layout are referring to fields of "RD"; the "Field" found in the
recursive visit is a member of Record (or
https://github.com/kees approved this pull request.
Tests and logic adjustment looks good to me.
https://github.com/llvm/llvm-project/pull/89126
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe
https://github.com/bwendling updated
https://github.com/llvm/llvm-project/pull/89126
>From 36ddb5811f11a1f6968705005713f34713026dbb Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Wed, 17 Apr 2024 12:23:02 -0700
Subject: [PATCH 1/2] [Clang] Handle structs with inner structs and no fields
A
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff 1460b4964c7ada2f7536006722c8585b5bd0a1b5
36ddb5811f11a1f6968705005713f34713026dbb --
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Bill Wendling (bwendling)
Changes
A struct that declares an inner struct, but no fields, won't have a field
count. So getting the offset of the inner struct fails. This happens in both C
and C++:
struct foo {
struct bar {
int
https://github.com/bwendling created
https://github.com/llvm/llvm-project/pull/89126
A struct that declares an inner struct, but no fields, won't have a field
count. So getting the offset of the inner struct fails. This happens in both C
and C++:
struct foo {
struct bar {
int Quan
31 matches
Mail list logo