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 &
@@ -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
@@ -4944,6 +4944,26 @@ void Parser::ParseStructDeclaration(
}
}
+// TODO: All callers of this function should be moved to
+// `Parser::ParseLexedAttributeList`.
+void Parser::ParseLexedCAttributeList(LateParsedAttrList , bool EnterScope,
+
@@ -4944,6 +4944,26 @@ void Parser::ParseStructDeclaration(
}
}
+// TODO: All callers of this function should be moved to
+// `Parser::ParseLexedAttributeList`.
+void Parser::ParseLexedCAttributeList(LateParsedAttrList , bool EnterScope,
+
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
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
@@ -4944,6 +4944,26 @@ void Parser::ParseStructDeclaration(
}
}
+// TODO: All callers of this function should be moved to
+// `Parser::ParseLexedAttributeList`.
+void Parser::ParseLexedCAttributeList(LateParsedAttrList , bool EnterScope,
+
@@ -8588,31 +8588,71 @@ static const RecordDecl
*GetEnclosingNamedOrTopAnonRecord(const FieldDecl *FD) {
return RD;
}
-static bool
-CheckCountExpr(Sema , FieldDecl *FD, Expr *E,
- llvm::SmallVectorImpl ) {
+enum class CountedByInvalidPointeeTypeKind {
+
@@ -2000,6 +2001,21 @@ class alignas(TypeAlignment) Type : public
ExtQualsTypeCommonBase {
unsigned NumExpansions;
};
+ class CountAttributedTypeBitfields {
+friend class CountAttributedType;
+
+LLVM_PREFERRED_TYPE(TypeBitfields)
+unsigned : NumTypeBits;
+
Timm =?utf-8?q?B=C3=A4der?=
Message-ID:
In-Reply-To:
hnrklssn wrote:
LGTM, but someone else should approve also.
https://github.com/llvm/llvm-project/pull/70772
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
hnrklssn wrote:
> > What differentiates the DecompositionDecl such that we need to mark the
> > decl invalid when there's an error in the RHS, while for other decls we
> > don't? It seems inconsistent.
>
>
>
> DecompositionDecl (aka structure binding) is special here, a legal
>
https://github.com/hnrklssn edited
https://github.com/llvm/llvm-project/pull/67519
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4,7 +4,8 @@
// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping
-dump-coverage-mapping -fprofile-list=%t-func.list -emit-llvm %s -o - |
FileCheck %s --check-prefix=FUNC
// RUN: echo "src:%s" | sed -e 's/\\//g' > %t-file.list
-// RUN: %clang_cc1
https://github.com/hnrklssn requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/67519
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hnrklssn wrote:
There's a dup of `Sema::isSimpleTypeSpecifier` in `FormatToken.cpp` that you
may want to update also: `FormatToken::isSimpleTypeSpecifier`. Perhaps that'll
make testing easier?
https://github.com/llvm/llvm-project/pull/72204
___
hnrklssn wrote:
What differentiates the DecompositionDecl such that we need to mark the decl
invalid when there's an error in the RHS, while for other decls we don't? It
seems inconsistent.
https://github.com/llvm/llvm-project/pull/72428
___
https://github.com/hnrklssn closed
https://github.com/llvm/llvm-project/pull/71171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hnrklssn wrote:
>I'd run ./llvm/utils/update_any_test_checks.py once and see if the tests pass
>afterwards.
Then do it again to ensure the nasty ordering and duplication issues are gone
for good.
All tests that fail after running update_any_test_checks.py also fail when
running it without
hnrklssn wrote:
> I think if the issues with the original commit are resolved, this is good to
> go.
>
> Did you verify we can properly auto-generate files, e.g., in
> llvm/test/Transforms/Attributor and clang/test/OpenMP?
>
>
Ah no I did not, I'll do that on Monday.
https://github.com/hnrklssn commented:
LGTM, but I'm not very familiar with the C++ specific parts of clang, so
someone else ought to take a look also
https://github.com/llvm/llvm-project/pull/70886
___
cfe-commits mailing list
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
hnrklssn wrote:
Nice. I realise you're following the convention already established in the test
file, but have you considered compiling with `-verify=new,both` and
`-verify=ref,both`, respectively, and combining the shared diagnostics into
hnrklssn wrote:
Would making a class with custom move and copy constructors with side effects,
and moving/copying an instance around a bit to affect the results of
static_asserts, work for testing?
https://github.com/llvm/llvm-project/pull/70772
___
@@ -429,3 +429,19 @@ namespace qualified_friend_no_match {
friend void Y::f(double); // expected-error {{friend declaration of 'f'
does not match any declaration in 'qualified_friend_no_match::Y'}}
};
}
+
+namespace gh21483 {
+template
+struct B {
+ struct mixin {
+
@@ -2537,19 +2555,13 @@ class FieldInitializerValidatorCCC final : public
CorrectionCandidateCallback {
/// actually be initialized.
hnrklssn wrote:
The comment above looks like it needs to be updated with `@param`s for
`FinishSubobjectInit`, `TopLevelObject`
@@ -4,7 +4,7 @@
// RUN: %clang_cc1 -std=c++20 %s -verify=cxx20,expected,reorder
-Wno-c99-designator -Werror=reorder-init-list -Wno-initializer-overrides
// RUN: %clang_cc1 -std=c++20 %s -verify=cxx20,expected,override
-Wno-c99-designator -Wno-reorder-init-list
@@ -429,3 +429,19 @@ namespace qualified_friend_no_match {
friend void Y::f(double); // expected-error {{friend declaration of 'f'
does not match any declaration in 'qualified_friend_no_match::Y'}}
};
}
+
+namespace gh21483 {
+template
+struct B {
+ struct mixin {
+
@@ -139,9 +139,23 @@ std::optional
ProfileList::isFileExcluded(StringRef FileName,
CodeGenOptions::ProfileInstrKind Kind) const {
StringRef Section = getSectionName(Kind);
- // Check for "source:="
+
+ // Convert the input file path to its
@@ -139,9 +139,23 @@ std::optional
ProfileList::isFileExcluded(StringRef FileName,
CodeGenOptions::ProfileInstrKind Kind) const {
StringRef Section = getSectionName(Kind);
- // Check for "source:="
+
+ // Convert the input file path to its
https://github.com/hnrklssn requested changes to this pull request.
Please update `clang/test/CodeGen/profile-filter.c` with some cases that
exercise the new code path.
https://github.com/llvm/llvm-project/pull/67519
___
cfe-commits mailing list
https://github.com/hnrklssn edited
https://github.com/llvm/llvm-project/pull/67519
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnrklssn closed
https://github.com/llvm/llvm-project/pull/67822
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnrklssn created
https://github.com/llvm/llvm-project/pull/67822
The addition of the type kind to the profile ID of IntegerLiterals results in
e.g. size_t and unsigned long literals mismatch even on platforms where they
are canonically the same type. This patch checks the
@@ -1333,7 +1333,13 @@ void StmtProfiler::VisitPredefinedExpr(const
PredefinedExpr *S) {
void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) {
VisitExpr(S);
S->getValue().Profile(ID);
- ID.AddInteger(S->getType()->castAs()->getKind());
+
+ QualType T =
@@ -1333,7 +1333,13 @@ void StmtProfiler::VisitPredefinedExpr(const
PredefinedExpr *S) {
void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) {
VisitExpr(S);
S->getValue().Profile(ID);
- ID.AddInteger(S->getType()->castAs()->getKind());
+
+ QualType T =
Author: Henrik G. Olsson
Date: 2023-07-05T14:04:50+02:00
New Revision: 8a3fdf7b908978625e9a7e57fbb443e4e6f98976
URL:
https://github.com/llvm/llvm-project/commit/8a3fdf7b908978625e9a7e57fbb443e4e6f98976
DIFF:
Author: Henrik G. Olsson
Date: 2022-11-30T15:06:32+01:00
New Revision: 8fa2e93538595e1ff973110cb3f301b65bc9d2eb
URL:
https://github.com/llvm/llvm-project/commit/8fa2e93538595e1ff973110cb3f301b65bc9d2eb
DIFF:
40 matches
Mail list logo