@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind {
VALID,
};
-static bool CheckCountedByAttrOnField(
-Sema &S, FieldDecl *FD, Expr *E,
-llvm::SmallVectorImpl &Decls) {
+static bool
+CheckCountedByAttrOnField(Sema &S, 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 byte
@@ -8697,9 +8708,10 @@ static bool CheckCountedByAttrOnField(
InvalidTypeKind = CountedByInvalidPointeeTypeKind::FLEXIBLE_ARRAY_MEMBER;
}
- if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID) {
+ if (InvalidTypeKind != CountedByInvalidPointeeTypeKind::VALID
@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind {
VALID,
};
-static bool CheckCountedByAttrOnField(
-Sema &S, FieldDecl *FD, Expr *E,
-llvm::SmallVectorImpl &Decls) {
+static bool
+CheckCountedByAttrOnField(Sema &S, FieldDecl *FD, Expr *E,
+
@@ -8641,22 +8641,33 @@ enum class CountedByInvalidPointeeTypeKind {
VALID,
};
-static bool CheckCountedByAttrOnField(
-Sema &S, FieldDecl *FD, Expr *E,
-llvm::SmallVectorImpl &Decls) {
+static bool
+CheckCountedByAttrOnField(Sema &S, FieldDecl *FD, Expr *E,
+
https://github.com/delcypher approved this pull request.
LGTM. Please fix the commit message when squashing.
https://github.com/llvm/llvm-project/pull/102076
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman
delcypher wrote:
@Xazax-hun This is something I'd like too. Unfortunately in previous
discussions we were asked to not do this.
https://github.com/llvm/llvm-project/pull/70480#discussion_r1379166020
https://github.com/llvm/llvm-project/pull/70480#discussion_r1377966526
As the number of tests gr
https://github.com/delcypher created
https://github.com/llvm/llvm-project/pull/102236
Previously we weren't properly checking that using
`-fexperimental-late-parse-attributes` worked on source code that didn't need
late parsing.
For example we weren't testing that the attribute appearing in t
@@ -80,10 +81,17 @@ struct found_outside_of_struct {
struct bar ** ptr __counted_by_or_null(global); // expected-error {{field
'global' in 'counted_by_or_null' not inside structure}}
};
+#ifndef LATE_PARSING_ENABLED
struct self_referrential {
int bork;
struct bar *se
https://github.com/delcypher updated
https://github.com/llvm/llvm-project/pull/102236
>From 885d40de074514cf349423e7ae387ccdf6dfbbc4 Mon Sep 17 00:00:00 2001
From: Dan Liew
Date: Tue, 6 Aug 2024 14:38:16 -0700
Subject: [PATCH 1/2] [Bounds Safety][NFC] Add some missing coverage for
`-fexperimen
https://github.com/delcypher updated
https://github.com/llvm/llvm-project/pull/102236
>From b5ce9c1f8de1deb90b9473ab26cd25c5111f7b42 Mon Sep 17 00:00:00 2001
From: Dan Liew
Date: Tue, 6 Aug 2024 14:38:16 -0700
Subject: [PATCH 1/2] [Bounds Safety][NFC] Add some missing coverage for
`-fexperimen
delcypher wrote:
@AaronBallman Thanks for the feedback. I've tried to make your suggested
changes.
https://github.com/llvm/llvm-project/pull/102236
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo
https://github.com/delcypher closed
https://github.com/llvm/llvm-project/pull/102236
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Dan Liew
Date: 2021-04-28T18:37:16-07:00
New Revision: 1bbbcff99de8e53b89146386bb2587ed4fc8e9cf
URL:
https://github.com/llvm/llvm-project/commit/1bbbcff99de8e53b89146386bb2587ed4fc8e9cf
DIFF:
https://github.com/llvm/llvm-project/commit/1bbbcff99de8e53b89146386bb2587ed4fc8e9cf.diff
LOG:
Author: Dan Liew
Date: 2021-04-29T11:55:42-07:00
New Revision: 2d42b2ee7bafe76d6b2c792b73f7371cb1cf8d94
URL:
https://github.com/llvm/llvm-project/commit/2d42b2ee7bafe76d6b2c792b73f7371cb1cf8d94
DIFF:
https://github.com/llvm/llvm-project/commit/2d42b2ee7bafe76d6b2c792b73f7371cb1cf8d94.diff
LOG:
Author: Dan Liew
Date: 2021-05-04T11:28:26-07:00
New Revision: 1971823ecb9eaa077554a5d268a44c7cb75eccce
URL:
https://github.com/llvm/llvm-project/commit/1971823ecb9eaa077554a5d268a44c7cb75eccce
DIFF:
https://github.com/llvm/llvm-project/commit/1971823ecb9eaa077554a5d268a44c7cb75eccce.diff
LOG:
Author: Dan Liew
Date: 2021-04-07T21:29:52-07:00
New Revision: 73cbc7f60ed90ad207b54b55aaf0efa0e5c38c47
URL:
https://github.com/llvm/llvm-project/commit/73cbc7f60ed90ad207b54b55aaf0efa0e5c38c47
DIFF:
https://github.com/llvm/llvm-project/commit/73cbc7f60ed90ad207b54b55aaf0efa0e5c38c47.diff
LOG:
Author: Dan Liew
Date: 2021-04-08T14:00:29-07:00
New Revision: f66e05a720f74409790bdede308380909f2ecd86
URL:
https://github.com/llvm/llvm-project/commit/f66e05a720f74409790bdede308380909f2ecd86
DIFF:
https://github.com/llvm/llvm-project/commit/f66e05a720f74409790bdede308380909f2ecd86.diff
LOG:
Author: Dan Liew
Date: 2021-04-13T11:58:33-07:00
New Revision: 4c0bc69490a57f2f8f9ede948e6d66cc0900879a
URL:
https://github.com/llvm/llvm-project/commit/4c0bc69490a57f2f8f9ede948e6d66cc0900879a
DIFF:
https://github.com/llvm/llvm-project/commit/4c0bc69490a57f2f8f9ede948e6d66cc0900879a.diff
LOG:
delcypher wrote:
@ahatanak Excited to see this finally land 🎉
https://github.com/llvm/llvm-project/pull/79230
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -186,4 +218,370 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) {
+ // Note: This implementation relies on `CountAttributedType` being uniqu
@@ -186,4 +218,370 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) {
delcypher wrote:
I've dropped the hacky implementation in
@@ -3343,6 +3363,8 @@ class CountAttributedType final
static bool classof(const Type *T) {
return T->getTypeClass() == CountAttributed;
}
+
+ StringRef GetAttributeName(bool WithMacroPrefix) const;
delcypher wrote:
I filed #113585 to track fixing this
@@ -186,4 +218,370 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) {
+ // Note: This implementation relies on `CountAttributedType` being uniqu
@@ -2438,6 +2438,22 @@ bool Type::isIncompleteType(NamedDecl **Def) const {
}
}
+bool Type::isIncompletableIncompleteType() const {
+ if (!isIncompleteType())
+return false;
+
+ // Forward declarations of structs, classes, enums, and unions could be later
+ // complet
@@ -3862,6 +3878,27 @@ CountAttributedType::CountAttributedType(
DeclSlot[i] = CoupledDecls[i];
}
+StringRef CountAttributedType::GetAttributeName(bool WithMacroPrefix) const {
delcypher wrote:
I've filed #113585 to track fixing the properly. I don't thin
delcypher wrote:
@Sirraide @erichkeane Sorry for the delay in addressing your feedback. This PR
is ready for another round of reviews. Note I'm aware there are some code
formatting problems. I'll fix them when I squash locally. I've tried to keep
all my tweaks as separate commits so it's easi
@@ -13559,6 +13562,27 @@ QualType Sema::CheckAssignmentOperands(Expr *LHSExpr,
ExprResult &RHS,
QualType LHSType = LHSExpr->getType();
QualType RHSType = CompoundType.isNull() ? RHS.get()->getType() :
CompoundType;
+
+ if (RHS.
@@ -8238,6 +8246,15 @@ ExprResult InitializationSequence::Perform(Sema &S,
}
}
+ // Note the return value isn't used to return early so that additional
+ // diagnostics can be emitted and to preserve the AST as best as possible
+ // even though an
@@ -13559,6 +13562,27 @@ QualType Sema::CheckAssignmentOperands(Expr *LHSExpr,
ExprResult &RHS,
QualType LHSType = LHSExpr->getType();
QualType RHSType = CompoundType.isNull() ? RHS.get()->getType() :
CompoundType;
+
+ if (RHS.
@@ -2440,6 +2440,26 @@ class alignas(TypeAlignment) Type : public
ExtQualsTypeCommonBase {
return !isFunctionType();
}
+ /// \returns True if the type is incomplete and it is also a type that
+ /// cannot be completed by a later type definition.
+ ///
+ /// E.g. For
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) {
+ // This is an approximation that's not quite right. This points to the
+
@@ -0,0 +1,584 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify
%s
+
+#define __counted_by(f) __attribute__((counted_by(f)))
+
+//
=
@@ -0,0 +1,584 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify
%s
+
+#define __counted_by(f) __attribute__((counted_by(f)))
+
+//
=
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) {
+ // This is an approximation that's not quite right. This points to the
+
@@ -0,0 +1,584 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify
%s
+
+#define __counted_by(f) __attribute__((counted_by(f)))
+
+//
=
@@ -8192,6 +8192,14 @@ ExprResult InitializationSequence::Perform(Sema &S,
Kind.getRange().getEnd());
} else {
CurInit = new (S.Context) ImplicitValueInitExpr(Step->Type);
+// Note the return value isn't used to return early
+// to pres
@@ -8238,6 +8246,15 @@ ExprResult InitializationSequence::Perform(Sema &S,
}
}
+ // Note the return value isn't used to return early so that additional
+ // diagnostics can be emitted and to preserve the AST as best as possible
+ // even though an
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/106321
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8207,6 +8207,14 @@ ExprResult InitializationSequence::Perform(Sema &S,
Kind.getRange().getEnd());
} else {
CurInit = new (S.Context) ImplicitValueInitExpr(Step->Type);
+// Note the return value isn't used to return early
+// to pres
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) {
+ // This is an approximation that's not quite right. This points to the
+
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) {
+ // This is an approximation that's not quite right. This points to the
+
@@ -102,7 +105,36 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
// only `PointeeTy->isStructureTypeWithFlexibleArrayMember()` is reachable
// when `FieldTy->isArrayType()`.
bool ShouldWarn = false;
- if (PointeeTy->isIncompleteType()
@@ -3907,6 +3923,31 @@ CountAttributedType::CountAttributedType(
DeclSlot[i] = CoupledDecls[i];
}
+StringRef CountAttributedType::getAttributeName(bool WithMacroPrefix) const {
+// TODO: This method isn't really ideal because it doesn't return the spelling
+// of the attri
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) {
+ // This is an approximation that's not quite right. This points to the
+
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) {
+ // This is an approximation that's not quite right. This points to the
+
@@ -13559,6 +13562,27 @@ QualType Sema::CheckAssignmentOperands(Expr *LHSExpr,
ExprResult &RHS,
QualType LHSType = LHSExpr->getType();
QualType RHSType = CompoundType.isNull() ? RHS.get()->getType() :
CompoundType;
+
+ if (RHS.
@@ -0,0 +1,584 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify
%s
+
+#define __counted_by(f) __attribute__((counted_by(f)))
+
+//
=
delcypher wrote:
@Sirraide Thanks for your review and sorry for the delay in getting back to
this. I've tried to address as much as possible and left comment on things that
still need discussion. Please take a look when time permits.
https://github.com/llvm/llvm-project/pull/106321
___
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) {
+ // This is an approximation that's not quite right. This points to the
+
@@ -19,13 +19,12 @@ struct on_member_pointer_complete_ty {
};
struct on_member_pointer_incomplete_ty {
- struct size_unknown * buf __counted_by(count); //
expected-error{{'counted_by' cannot be applied to a pointer with pointee of
unknown size because 'struct size_unknown'
@@ -13559,6 +13562,27 @@ QualType Sema::CheckAssignmentOperands(Expr *LHSExpr,
ExprResult &RHS,
QualType LHSType = LHSExpr->getType();
QualType RHSType = CompoundType.isNull() ? RHS.get()->getType() :
CompoundType;
+
+ if (RHS.
https://github.com/delcypher deleted
https://github.com/llvm/llvm-project/pull/106321
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3907,6 +3923,31 @@ CountAttributedType::CountAttributedType(
DeclSlot[i] = CoupledDecls[i];
}
+StringRef CountAttributedType::getAttributeName(bool WithMacroPrefix) const {
+// TODO: This method isn't really ideal because it doesn't return the spelling
+// of the attri
@@ -2068,13 +2068,55 @@ class Sema final : public SemaBase {
bool CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes,
bool OrNull);
+ /// Perform Bounds Safety Semantic checks for assigning to a `__counted_by`
or
+ /// `__
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) {
+ // This is an approximation that's not quite right. This points to the
+
@@ -3907,6 +3923,31 @@ CountAttributedType::CountAttributedType(
DeclSlot[i] = CoupledDecls[i];
}
+StringRef CountAttributedType::getAttributeName(bool WithMacroPrefix) const {
+// TODO: This method isn't really ideal because it doesn't return the spelling
@@ -186,4 +218,206 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+static void EmitIncompleteCountedByPointeeNotes(Sema &S,
+const CountAttributedType
*CATy,
+
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) {
+ // This is an approximation that's not quite right. This points to the
+
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/106321
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -19,13 +19,12 @@ struct on_member_pointer_complete_ty {
};
struct on_member_pointer_incomplete_ty {
- struct size_unknown * buf __counted_by(count); //
expected-error{{'counted_by' cannot be applied to a pointer with pointee of
unknown size because 'struct size_unknown'
@@ -0,0 +1,584 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify
%s
+
+#define __counted_by(f) __attribute__((counted_by(f)))
+
+//
=
@@ -3907,6 +3923,31 @@ CountAttributedType::CountAttributedType(
DeclSlot[i] = CoupledDecls[i];
}
+StringRef CountAttributedType::getAttributeName(bool WithMacroPrefix) const {
+// TODO: This method isn't really ideal because it doesn't return the spelling
+// of the attri
delcypher wrote:
@erichkeane @AaronBallman @Sirraide I've addressed everything I can.
I seem to be running into a problem where some of my replies to comments are
not showing up in the conversation tab. This seems to be a [known problem with
GitHub reviews
](https://github.com/orgs/community
delcypher wrote:
[This
comment](https://github.com/llvm/llvm-project/pull/106321/files#r1906005324) is
not showing up in the conversation view for some reason.
https://github.com/llvm/llvm-project/pull/106321
___
cfe-commits mailing list
cfe-commits@
@@ -8207,6 +8207,14 @@ ExprResult InitializationSequence::Perform(Sema &S,
Kind.getRange().getEnd());
} else {
CurInit = new (S.Context) ImplicitValueInitExpr(Step->Type);
+// Note the return value isn't used to return early
+// to pres
@@ -0,0 +1,87 @@
+==
+Adoption Guide for ``-fbounds-safety``
+==
+
+.. contents::
+ :local:
+
+Where to get ``-fbounds-safety``
+
+
+The open sourcing to llvm.org's ``llvm-pro
@@ -0,0 +1,87 @@
+==
+Adoption Guide for ``-fbounds-safety``
+==
+
+.. contents::
+ :local:
+
+Where to get ``-fbounds-safety``
+
+
+The open sourcing to llvm.org's ``llvm-pro
@@ -0,0 +1,87 @@
+==
+Adoption Guide for ``-fbounds-safety``
+==
+
+.. contents::
+ :local:
+
+Where to get ``-fbounds-safety``
+
+
+The open sourcing to llvm.org's ``llvm-pro
@@ -0,0 +1,87 @@
+==
+Adoption Guide for ``-fbounds-safety``
+==
+
+.. contents::
+ :local:
+
+Where to get ``-fbounds-safety``
+
+
+The open sourcing to llvm.org's ``llvm-pro
@@ -0,0 +1,87 @@
+==
+Adoption Guide for ``-fbounds-safety``
+==
+
+.. contents::
+ :local:
+
+Where to get ``-fbounds-safety``
+
+
+The open sourcing to llvm.org's ``llvm-pro
https://github.com/delcypher requested changes to this pull request.
Seems reasonable and something we can expand on. The main issue is the fact
`-fbounds-safety` is a cc1 option while this doc is written assuming its a
driver option.
https://github.com/llvm/llvm-project/pull/120674
__
@@ -0,0 +1,87 @@
+==
+Adoption Guide for ``-fbounds-safety``
+==
+
+.. contents::
+ :local:
+
+Where to get ``-fbounds-safety``
+
+
+The open sourcing to llvm.org's ``llvm-pro
@@ -0,0 +1,87 @@
+==
+Adoption Guide for ``-fbounds-safety``
+==
+
+.. contents::
+ :local:
+
+Where to get ``-fbounds-safety``
+
+
+The open sourcing to llvm.org's ``llvm-pro
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/120674
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,87 @@
+==
+Adoption Guide for ``-fbounds-safety``
+==
+
+.. contents::
+ :local:
+
+Where to get ``-fbounds-safety``
+
+
+The open sourcing to llvm.org's ``llvm-pro
delcypher wrote:
@MaskRay So this is actually part of [my GSoc
proposal](https://discourse.llvm.org/t/clang-gsoc-2025-usability-improvements-for-trapping-undefined-behavior-sanitizer/84568/15?u=dan_liew).
There's an explanation in the discord post about why I believe it's the wrong
behavior. I
@@ -0,0 +1,584 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify
%s
+
+#define __counted_by(f) __attribute__((counted_by(f)))
+
+//
=
@@ -186,4 +218,188 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+static void EmitIncompleteCountedByPointeeNotes(Sema &S,
+const CountAttributedType
*CATy,
+
@@ -0,0 +1,584 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify
%s
+
+#define __counted_by(f) __attribute__((counted_by(f)))
+
+//
=
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/106321
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/delcypher updated
https://github.com/llvm/llvm-project/pull/106321
>From e10de17bf7e56cfe50c144e82396851a47ceead5 Mon Sep 17 00:00:00 2001
From: Dan Liew
Date: Thu, 15 Aug 2024 16:33:04 -0700
Subject: [PATCH] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null
on po
@@ -186,4 +218,188 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+static void EmitIncompleteCountedByPointeeNotes(Sema &S,
+const CountAttributedType
*CATy,
+
delcypher wrote:
@Sirraide Apologies for taking so long to get back to this PR. I think I've
addressed all your feedback now. Is this ok to land now?
https://github.com/llvm/llvm-project/pull/106321
___
cfe-commits mailing list
cfe-commits@lists.llvm.
@@ -186,4 +218,188 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+static void EmitIncompleteCountedByPointeeNotes(Sema &S,
+const CountAttributedType
*CATy,
+
https://github.com/delcypher updated
https://github.com/llvm/llvm-project/pull/106321
>From b17b93dc917077cb588befde683a621e096c4f85 Mon Sep 17 00:00:00 2001
From: Dan Liew
Date: Thu, 15 Aug 2024 16:33:04 -0700
Subject: [PATCH] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null
on po
@@ -186,4 +218,188 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+static void EmitIncompleteCountedByPointeeNotes(Sema &S,
+const CountAttributedType
*CATy,
+
https://github.com/delcypher updated
https://github.com/llvm/llvm-project/pull/106321
>From f5b291e55859265c227427d0d630f8f698320a84 Mon Sep 17 00:00:00 2001
From: Dan Liew
Date: Thu, 15 Aug 2024 16:33:04 -0700
Subject: [PATCH] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null
on po
@@ -186,4 +218,188 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr
*E, bool CountInBytes,
return false;
}
+static void EmitIncompleteCountedByPointeeNotes(Sema &S,
+const CountAttributedType
*CATy,
+
delcypher wrote:
I had to tweak some minor issues with the diagnostic text that I discovered
when trying to cherry pick this into our fork. I've fixed them and I'm going to
land this now.
https://github.com/llvm/llvm-project/pull/106321
___
cfe-commi
https://github.com/delcypher closed
https://github.com/llvm/llvm-project/pull/106321
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8197,6 +8197,16 @@ def err_address_space_qualified_new : Error<
def err_address_space_qualified_delete : Error<
"'delete' cannot delete objects of type %0 in address space '%1'">;
+def note_default_init_const_member : Note<
+ "member %0 declared 'const' here">;
+def war
@@ -2533,6 +2533,31 @@ def fno_sanitize_merge_handlers : Flag<["-"],
"fno-sanitize-merge">, Group,
AliasArgs<["all"]>,
Visibility<[ClangOption, CLOption]>,
HelpText<"Do not allow compiler to merge handlers for
any sanitizers">;
https://github.com/delcypher edited
https://github.com/llvm/llvm-project/pull/138577
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/delcypher requested changes to this pull request.
Seems reasonable. My main issue is the "add pseudo functions" name which isn't
clear and isn't documented.
https://github.com/llvm/llvm-project/pull/138577
___
cfe-commits mailing li
@@ -2533,6 +2533,31 @@ def fno_sanitize_merge_handlers : Flag<["-"],
"fno-sanitize-merge">, Group,
AliasArgs<["all"]>,
Visibility<[ClangOption, CLOption]>,
HelpText<"Do not allow compiler to merge handlers for
any sanitizers">;
delcypher wrote:
> I think this should be fine at this point. I’m having a bit of a hard time
> trying to figure out what changed since my last review because of the
> force-pushing, but so long as you haven’t made any other major changes since
> then then this ltgm now.
Sorry about that. Thi
@@ -8663,31 +8663,95 @@ static const RecordDecl
*GetEnclosingNamedOrTopAnonRecord(const FieldDecl *FD) {
return RD;
}
-static bool
-CheckCountExpr(Sema &S, FieldDecl *FD, Expr *E,
- llvm::SmallVectorImpl &Decls) {
+enum class CountedByInvalidPointeeTypeKind {
@@ -2779,13 +2779,47 @@ void
CodeGenFunction::EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD,
}
}
+std::pair
+CodeGenFunction::ParseCFITypeCheckKind(CFITypeCheckKind TCK) {
+ SanitizerKind::SanitizerOrdinal M;
+ llvm::SanitizerStatKind SSK;
+
+ switch (TCK) {
+ ca
@@ -2779,13 +2779,47 @@ void
CodeGenFunction::EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD,
}
}
+std::pair
+CodeGenFunction::ParseCFITypeCheckKind(CFITypeCheckKind TCK) {
+ SanitizerKind::SanitizerOrdinal M;
+ llvm::SanitizerStatKind SSK;
+
+ switch (TCK) {
+ ca
301 - 400 of 447 matches
Mail list logo