@@ -8697,9 +8708,10 @@ static bool CheckCountedByAttrOnField(
InvalidTypeKind = CountedByInvalidPointeeTypeKind::FLEXIBLE_ARRAY_MEMBER;
}
- if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID) {
+ if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID
@@ -8697,9 +8708,10 @@ static bool CheckCountedByAttrOnField(
InvalidTypeKind = CountedByInvalidPointeeTypeKind::FLEXIBLE_ARRAY_MEMBER;
}
- if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID) {
+ if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID
https://github.com/delcypher requested changes to this pull request.
I'm requesting changes for now but we can change this based on @rapidsna 's
opinion.
https://github.com/llvm/llvm-project/pull/93231
___
cfe-commits mailing list
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/93231
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/AaronBallman approved this pull request.
Continues to LGTM, @delcypher are you happy with the changes?
https://github.com/llvm/llvm-project/pull/93231
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
hnrklssn wrote:
Rebased on main after @delcypher's patch was relanded. Addressing comments now.
https://github.com/llvm/llvm-project/pull/93231
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/hnrklssn updated
https://github.com/llvm/llvm-project/pull/93231
>From 5c5a28415f2cc10525f07784e6896718cc38624f Mon Sep 17 00:00:00 2001
From: "Henrik G. Olsson"
Date: Thu, 23 May 2024 11:44:41 -0700
Subject: [PATCH] [Bounds-Safety] Add sized_by, counted_by_or_null &
https://github.com/rapidsna approved this pull request.
https://github.com/llvm/llvm-project/pull/93231
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -425,6 +425,12 @@ Attribute Changes in Clang
size_t count;
};
+- The attributes ``sized_by``, ``counted_by_or_null`` and ``sized_by_or_null```
+ have been added as variants on ``counted_by``, each with slightly different
semantics.
+ ``sized_by`` takes a
https://github.com/AaronBallman approved this pull request.
There are a few minor suggestions from @delcypher that should be addressed, but
overall the changes LGTM (assuming there are no precommit CI surprises after
fixing the merge conflicts).
https://github.com/llvm/llvm-project/pull/93231
@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind {
VALID,
};
-static bool CheckCountedByAttrOnField(
-Sema , FieldDecl *FD, Expr *E,
-llvm::SmallVectorImpl ) {
+static bool
+CheckCountedByAttrOnField(Sema , FieldDecl *FD, Expr *E,
+
@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind {
VALID,
};
-static bool CheckCountedByAttrOnField(
-Sema , FieldDecl *FD, Expr *E,
-llvm::SmallVectorImpl ) {
+static bool
+CheckCountedByAttrOnField(Sema , FieldDecl *FD, Expr *E,
+
@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind {
VALID,
};
-static bool CheckCountedByAttrOnField(
-Sema , FieldDecl *FD, Expr *E,
-llvm::SmallVectorImpl ) {
+static bool
+CheckCountedByAttrOnField(Sema , FieldDecl *FD, Expr *E,
+
@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind {
VALID,
};
-static bool CheckCountedByAttrOnField(
-Sema , FieldDecl *FD, Expr *E,
-llvm::SmallVectorImpl ) {
+static bool
+CheckCountedByAttrOnField(Sema , FieldDecl *FD, Expr *E,
+
@@ -425,6 +425,12 @@ Attribute Changes in Clang
size_t count;
};
+- The attributes ``sized_by``, ``counted_by_or_null`` and ``sized_by_or_null```
+ have been added as variants on ``counted_by``, each with slightly different
semantics.
+ ``sized_by`` takes a
@@ -8697,9 +8708,10 @@ static bool CheckCountedByAttrOnField(
InvalidTypeKind = CountedByInvalidPointeeTypeKind::FLEXIBLE_ARRAY_MEMBER;
}
- if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID) {
+ if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID
@@ -8697,9 +8708,10 @@ static bool CheckCountedByAttrOnField(
InvalidTypeKind = CountedByInvalidPointeeTypeKind::FLEXIBLE_ARRAY_MEMBER;
}
- if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID) {
+ if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID
@@ -425,6 +425,12 @@ Attribute Changes in Clang
size_t count;
};
+- The attributes ``sized_by``, ``counted_by_or_null`` and ``sized_by_or_null```
+ have been added as variants on ``counted_by``, each with slightly different
semantics.
+ ``sized_by`` takes a
@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind {
VALID,
};
-static bool CheckCountedByAttrOnField(
-Sema , FieldDecl *FD, Expr *E,
-llvm::SmallVectorImpl ) {
+static bool
+CheckCountedByAttrOnField(Sema , FieldDecl *FD, Expr *E,
+
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/93231
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind {
VALID,
};
-static bool CheckCountedByAttrOnField(
-Sema , FieldDecl *FD, Expr *E,
-llvm::SmallVectorImpl ) {
+static bool
+CheckCountedByAttrOnField(Sema , FieldDecl *FD, Expr *E,
+
@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind {
VALID,
};
-static bool CheckCountedByAttrOnField(
-Sema , FieldDecl *FD, Expr *E,
-llvm::SmallVectorImpl ) {
+static bool
+CheckCountedByAttrOnField(Sema , FieldDecl *FD, Expr *E,
+
https://github.com/delcypher requested changes to this pull request.
Looks pretty good. I have some minor comments.
https://github.com/llvm/llvm-project/pull/93231
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
delcypher wrote:
@hnrklssn #93121 has been landed. Let's hope it sticks this time 爛
https://github.com/llvm/llvm-project/pull/93231
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hnrklssn wrote:
Blocked by pointer support for `counted_by` reverted. It's being relanded in
#93121
https://github.com/llvm/llvm-project/pull/93231
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Henrik G. Olsson (hnrklssn)
Changes
The attributes `sized_by`, `counted_by_or_null` and `sized_by_or_null` have
been added as variants on `counted_by`, each with slightly different semantics.
`sized_by` takes a byte size parameter
https://github.com/hnrklssn created
https://github.com/llvm/llvm-project/pull/93231
The attributes `sized_by`, `counted_by_or_null` and `sized_by_or_null` have
been added as variants on `counted_by`, each with slightly different semantics.
`sized_by` takes a byte size parameter instead of an
27 matches
Mail list logo