https://github.com/a-nogikh created
https://github.com/llvm/llvm-project/pull/168840
Consider a newly added "malloc_span" attribute in the allocation token
instrumentation to ensure that __size_returning_new variants are correctly
identified as memory allocation functions.
Adjust the allocati
@@ -1839,6 +1839,70 @@ static void handleRestrictAttr(Sema &S, Decl *D, const
ParsedAttr &AL) {
RestrictAttr(S.Context, AL, DeallocE, DeallocPtrIdx));
}
+bool Sema::CheckSpanLikeType(const AttributeCommonInfo &CI,
+ const QualType
https://github.com/a-nogikh updated
https://github.com/llvm/llvm-project/pull/167010
>From 2d0bf7d9a584cefda1e7a9435e345e13c24e40ed Mon Sep 17 00:00:00 2001
From: Aleksandr Nogikh
Date: Fri, 17 Oct 2025 18:05:36 +0200
Subject: [PATCH 01/20] [Clang] Introduce malloc_span attribute
The "malloc"
https://github.com/a-nogikh commented:
LGTM
https://github.com/llvm/llvm-project/pull/168689
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/a-nogikh edited
https://github.com/llvm/llvm-project/pull/167010
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1839,6 +1839,41 @@ static void handleRestrictAttr(Sema &S, Decl *D, const
ParsedAttr &AL) {
RestrictAttr(S.Context, AL, DeallocE, DeallocPtrIdx));
}
+static bool isSpanLikeType(const QualType &Ty) {
+ // Check that the type is a plain record with one fie
https://github.com/a-nogikh updated
https://github.com/llvm/llvm-project/pull/167010
>From e0fa07d42042a391fc92c71e6e2e378dd58a775b Mon Sep 17 00:00:00 2001
From: Aleksandr Nogikh
Date: Fri, 17 Oct 2025 18:05:36 +0200
Subject: [PATCH 01/13] [Clang] Introduce malloc_span attribute
The "malloc"
@@ -1839,6 +1839,41 @@ static void handleRestrictAttr(Sema &S, Decl *D, const
ParsedAttr &AL) {
RestrictAttr(S.Context, AL, DeallocE, DeallocPtrIdx));
}
+static bool isSpanLikeType(const QualType &Ty) {
a-nogikh wrote:
Renamed to `checkSpanL
https://github.com/a-nogikh updated
https://github.com/llvm/llvm-project/pull/167010
>From e0fa07d42042a391fc92c71e6e2e378dd58a775b Mon Sep 17 00:00:00 2001
From: Aleksandr Nogikh
Date: Fri, 17 Oct 2025 18:05:36 +0200
Subject: [PATCH 1/2] [Clang] Introduce malloc_span attribute
The "malloc" at
https://github.com/a-nogikh edited
https://github.com/llvm/llvm-project/pull/167010
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/a-nogikh converted_to_draft
https://github.com/llvm/llvm-project/pull/165433
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1839,6 +1839,39 @@ static void handleRestrictAttr(Sema &S, Decl *D, const
ParsedAttr &AL) {
RestrictAttr(S.Context, AL, DeallocE, DeallocPtrIdx));
}
+static bool isSpanLikeType(const QualType &Ty) {
+ // Check that the type is a plain record with the fir
@@ -6642,7 +6642,8 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType,
CalleeDecl);
}
if (CalleeDecl->hasAttr() ||
-CalleeDecl->hasAttr()) {
+CalleeDecl->hasAttr() ||
+CalleeDecl->hasAttr()) {
--
https://github.com/a-nogikh updated
https://github.com/llvm/llvm-project/pull/167010
>From 520daa237bdd014dd6f8f14f29d6b304d9440b4a Mon Sep 17 00:00:00 2001
From: Aleksandr Nogikh
Date: Fri, 17 Oct 2025 18:05:36 +0200
Subject: [PATCH] [Clang] Introduce malloc_span attribute
The "malloc" attrib
a-nogikh wrote:
This PR is a reworked version of
https://github.com/llvm/llvm-project/pull/165433. The original PR proposed the
changes to the semantics of the `malloc` attribute itself, but the consensus
was that adding a separate `malloc_attribute` would be a better approach.
https://github
a-nogikh wrote:
A pull request with the `malloc_span` implementation:
https://github.com/llvm/llvm-project/pull/167010
https://github.com/llvm/llvm-project/pull/165433
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-
https://github.com/a-nogikh created
https://github.com/llvm/llvm-project/pull/167010
The "malloc" attribute restricts the possible function signatures to the ones
returning a pointer, which is not the case for some non-standard allocation
function variants. For example, P0901R11 proposed ::ope
https://github.com/a-nogikh closed
https://github.com/llvm/llvm-project/pull/166937
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/a-nogikh created
https://github.com/llvm/llvm-project/pull/166937
The "malloc" attribute restricts the possible function signatures to
the ones returning a pointer, which is not the case for some non-standard
allocation functions variants. For example, P0901R11 proposed ::oper
a-nogikh wrote:
Thank you for the feedback!
* I've sent an email to [email protected]:
https://gcc.gnu.org/pipermail/gcc/2025-November/246931.html
* Dropped the `alloc_size`-related changes from the PR: after some more
consideration, they didn't seem really necessary and only complicated the
c
https://github.com/a-nogikh edited
https://github.com/llvm/llvm-project/pull/165433
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/a-nogikh edited
https://github.com/llvm/llvm-project/pull/165433
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5753,3 +5753,23 @@ StringRef PredefinedSugarType::getName(Kind KD) {
}
llvm_unreachable("unexpected kind");
}
+
+bool Type::isSpanLikeType() const {
a-nogikh wrote:
Hmm, yes, indeed, there are pointer+int structs that are not span-like at all.
I've mo
https://github.com/a-nogikh updated
https://github.com/llvm/llvm-project/pull/165433
>From cb8dba47bb92b013e92b9a9fc6fc434e5f20ce92 Mon Sep 17 00:00:00 2001
From: Aleksandr Nogikh
Date: Fri, 17 Oct 2025 18:05:36 +0200
Subject: [PATCH 1/4] [Clang] Allow malloc and alloc_size attributes for
func
https://github.com/a-nogikh created
https://github.com/llvm/llvm-project/pull/165433
These attributes restrict the possible function signatures to the ones
returning a pointer, which is not the case for some non-standard allocation
functions variants. For example, P0901R11 proposed ::operator
25 matches
Mail list logo