https://github.com/hnrklssn created
https://github.com/llvm/llvm-project/pull/137078
When `ArePotentiallyOverlappingStringLiterals`, added in
https://github.com/llvm/llvm-project/pull/109208, compares string literals it
drops the front of the string with the greatest offset from its base point
hnrklssn wrote:
> Thanks for the fix!
>
> I was wondering if the new code paths should actually return `true` not
> `false`, but I think it makes sense that for a comparison like `"hello" + 6
> == "world"`, we say that the strings are _not_ potentially-overlapping but we
> instead detect the
@@ -119,6 +119,15 @@ constexpr auto b3 = name1() == name1(); // ref-error
{{must be initialized by a
constexpr auto b4 = name1() == name2();
static_assert(!b4);
+constexpr auto bar(const char *p) { return p + __builtin_strlen(p); }
+constexpr auto b5 = bar(p1) == p1;
+static_
https://github.com/hnrklssn closed
https://github.com/llvm/llvm-project/pull/137078
___
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/137088
Reverts llvm/llvm-project#137078
>From 30f38f86a765a24e368083ffbcac9f036e6fc221 Mon Sep 17 00:00:00 2001
From: "Henrik G. Olsson"
Date: Wed, 23 Apr 2025 16:48:29 -0700
Subject: [PATCH] Revert "[ConstEval] Fix
@@ -119,6 +119,15 @@ constexpr auto b3 = name1() == name1(); // ref-error
{{must be initialized by a
constexpr auto b4 = name1() == name2();
static_assert(!b4);
+constexpr auto bar(const char *p) { return p + __builtin_strlen(p); }
+constexpr auto b5 = bar(p1) == p1;
+static_
hnrklssn wrote:
@mizvekov
We got some downstream failures from this. I was wondering about the case when
the expression sometimes is a character literal, but not always. Previously we
would get diagnostics like this:
```
lorem 0 ipsum
lorem 'X' ipsum
```
while with this change we get:
```
lore
https://github.com/hnrklssn closed
https://github.com/llvm/llvm-project/pull/129954
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
=?utf-8?q?Félix?= Cloutier ,
=?utf-8?q?Félix?= Cloutier ,
=?utf-8?q?Félix?= Cloutier ,
=?utf-8?q?Félix?= Cloutier ,
=?utf-8?q?Félix?= Cloutier ,
=?utf-8?q?Félix?= Cloutier ,
=?utf-8?q?Félix?= Cloutier ,
=?utf-8?q?Félix?= Cloutier ,
=?utf-8?q?Félix?= Cloutier ,
=?utf-8?q?Félix?= Cloutier ,
=?utf-8?q
@@ -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 {
https://github.com/hnrklssn edited
https://github.com/llvm/llvm-project/pull/93121
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnrklssn updated
https://github.com/llvm/llvm-project/pull/143739
>From 89179c0d4ebcbc5311af73ce293d9297e196b786 Mon Sep 17 00:00:00 2001
From: "Henrik G. Olsson"
Date: Wed, 11 Jun 2025 17:36:29 +0200
Subject: [PATCH] [Modules] Record whether VarDecl initializers contain side
hnrklssn wrote:
> > The direction meets my expectation. I think you already have an existing
> > test for swift. Maybe you can try to reduce a lit test from it.
>
> Yeah, I've tried reducing a lit test, but my reduced case doesn't trigger the
> original assert because the initializer is alread
hnrklssn wrote:
> I think this new function should be called from
> `ASTContext::DeclMustBeEmitted`, no?
Of course, yes! Fixed now.
https://github.com/llvm/llvm-project/pull/143739
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists
https://github.com/hnrklssn updated
https://github.com/llvm/llvm-project/pull/143739
>From eacaac0ce4177a45183e1f8c878bc2085b443983 Mon Sep 17 00:00:00 2001
From: "Henrik G. Olsson"
Date: Wed, 11 Jun 2025 17:36:29 +0200
Subject: [PATCH 1/2] [Modules] Record whether VarDecl initializers contain
@@ -2434,6 +2434,31 @@ VarDecl *VarDecl::getInitializingDeclaration() {
return Def;
}
+bool VarDecl::hasInitWithSideEffects() const {
+ if (!hasInit())
+return false;
+
+ // Check if we can get the initializer without deserializing
+ const Expr *E = nullptr;
+ if (au
https://github.com/hnrklssn updated
https://github.com/llvm/llvm-project/pull/143739
>From a8042b8412a5621e977af8d16d704bee2f64c0e7 Mon Sep 17 00:00:00 2001
From: "Henrik G. Olsson"
Date: Wed, 11 Jun 2025 17:36:29 +0200
Subject: [PATCH] [Modules] Record whether VarDecl initializers contain side
hnrklssn wrote:
@ChuanqiXu9 I pushed a new fix based on your feedback. Please let me know what
you think. I don't really know how to test this, so if you think it needs
testing I'm open for suggestions.
https://github.com/llvm/llvm-project/pull/143739
__
https://github.com/hnrklssn updated
https://github.com/llvm/llvm-project/pull/143739
>From 44e965edaf6338c46bae8fabbf06b3f4e9173703 Mon Sep 17 00:00:00 2001
From: "Henrik G. Olsson"
Date: Wed, 11 Jun 2025 17:36:29 +0200
Subject: [PATCH] [Modules] Record whether VarDecl initializers contain side
https://github.com/hnrklssn updated
https://github.com/llvm/llvm-project/pull/143739
>From d239fee7d5fd002edb08a24b4de1db84433413fe Mon Sep 17 00:00:00 2001
From: "Henrik G. Olsson"
Date: Wed, 11 Jun 2025 17:36:29 +0200
Subject: [PATCH] [Modules] Record whether VarDecl initializers contain side
https://github.com/hnrklssn edited
https://github.com/llvm/llvm-project/pull/143739
___
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/143739
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hnrklssn wrote:
> What is the difference between this one and the previous PR?
The second commit, where I prevent constant evaluation if the expression type
is null
https://github.com/llvm/llvm-project/pull/145447
___
cfe-commits mailing list
cfe-com
https://github.com/hnrklssn created
https://github.com/llvm/llvm-project/pull/143739
This assert was reportedly added to "Defensively ensure that
GetExternalDeclStmt protects itself from nested deserialization". In the tests
for https://github.com/swiftlang/swift/pull/81859 I was able to trigg
hnrklssn wrote:
> I think we shouldn't remove the assertion. Your test passes with the removal
> of the assertion since the initializers are not complex. So it ends quickly.
> But if it is a complex initialization which triggers more deserialization, I
> feel it will be problematic.
>
> I thi
https://github.com/hnrklssn updated
https://github.com/llvm/llvm-project/pull/146468
>From c7d7419e13ec4f8951b76fcae5570bba772dc4dd Mon Sep 17 00:00:00 2001
From: "Henrik G. Olsson"
Date: Mon, 30 Jun 2025 21:26:19 -0700
Subject: [PATCH] [Modules] Record side effect info in EvaluatedStmt
All de
https://github.com/hnrklssn updated
https://github.com/llvm/llvm-project/pull/146468
>From 39fa1a4610cf14d6288abab07f25c7f735c62508 Mon Sep 17 00:00:00 2001
From: "Henrik G. Olsson"
Date: Mon, 30 Jun 2025 21:26:19 -0700
Subject: [PATCH] [Modules] Record side effect info in EvaluatedStmt
All de
hnrklssn wrote:
@ChuanqiXu9 After investigating the test failures for my previous fix I
realised I'd misunderstood `EvaluatedStmt`. That fix caused test failures
because it essentially ignored `EvaluatedStmt` initializers if they didn't
originate in a deserialized AST and were known to have si
https://github.com/hnrklssn closed
https://github.com/llvm/llvm-project/pull/146468
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hnrklssn wrote:
> I patched #146468 after this change, rebuilt the compiler and reproduced the
> same crash. So I guess that patch does not fix the issue I see here. Does
> #146468 depend on some other change?
It does not. Do you have a reproducer you can share? Does the type that's being
cas
https://github.com/hnrklssn created
https://github.com/llvm/llvm-project/pull/146468
This fixes another instance of `Assertion failed:
(NumCurrentElementsDeserializing == 0 && "should not be called while already
deserializing")`. I ran into it while importing clang modules from Swift, but I
h
hnrklssn wrote:
> The change LGTM but I want a test to avoid further regression.
Yup, working on it
https://github.com/llvm/llvm-project/pull/146468
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinf
hnrklssn wrote:
> @hnrklssn we (at google) have bisected a clang crash at the original commit
> (https://github.com/llvm/llvm-project/commit/319a51a5ffb807b88ae7f73676894bf306a0d134)
> that also reproduces at this revision.
>
>
>
> Here's the stack trace:
>
>
>
> ```
>
> assert.h asserti
hnrklssn wrote:
> > You don't happen to be using the new constant interpreter?
>
> Not sure what you mean by this. We're using the unmodified compiler and
> testing its correctness on google internal code.
Then you're likely not. I was just making sure, because the constant evaluation
takes a
101 - 134 of 134 matches
Mail list logo