[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-21 Thread Ding Fei via cfe-commits
danix800 wrote: For this testcase, two constrainst are collected on the path: ```c (1) a + b + c == d (2) b + c = 0 ``` when assuming the third constraint `b == 0`, (1) or (2) is selected at random order for simplifying eq class. The fixedpoint simplification algorithm will recurse by `Re-eva

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-19 Thread Ding Fei via cfe-commits
danix800 wrote: > Thank you for your dedication. What are your plans? Do you plan to continue > pushing this? > > Btw why did this test only fail on Windows? I'll further investigate if it's possilbe to do similar improvement on the solver in other ways. https://github.com/llvm/llvm-project/

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-19 Thread Ding Fei via cfe-commits
danix800 wrote: It is unstable ordering of elements from DenseMap/Set. This PR actually breaks the recursive fixpoint simplification algorithm of the eq class. One thing left which confused me is that why no randomness is observed when compiled by gcc on linux, purely out of coincidence? htt

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-19 Thread Ding Fei via cfe-commits
danix800 wrote: > I'm not sure I see why. The logs I linked in the revert only showed a single > test failure. The new test we added in this PR. This suggests close > correlations. Maybe the content of the "constraints" map in the State is > dumped in a non-deterministic order? And we just hap

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-18 Thread Ding Fei via cfe-commits
danix800 wrote: > @danix800 Could you please have a look at the failed test, such that we could > reapply this PR? I reverted this soon after I realized the broken test is > from this PR. The test randomly fails for unknown reason, on VS2019~2022, after 1c154bd755153b5c6ada4bbed58facf23f6abff

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-15 Thread Ding Fei via cfe-commits
danix800 wrote: > @danix800 Could you please have a look at the failed test, such that we could > reapply this PR? I reverted this soon after I realized the broken test is > from this PR. Working on it! https://github.com/llvm/llvm-project/pull/115579 _

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-15 Thread Ding Fei via cfe-commits
danix800 wrote: > LGTM now. Thank you for this high quality patch. This isn't the first time, I > remember. Excellent track record. Thanks for your reviews and all of your kindness! @steakhal @NagyDonat https://github.com/llvm/llvm-project/pull/115579 _

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-15 Thread Ding Fei via cfe-commits
https://github.com/danix800 closed https://github.com/llvm/llvm-project/pull/115579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-14 Thread Ding Fei via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_analyze_cc1 %s \ +// RUN: -analyzer-checker=debug.ExprInspection \ +// RUN: -verify danix800 wrote: Thanks for reminding of this! Fixed! https://github.com/llvm/llvm-project/pull/115579 ___

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-14 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/115579 >From 19b47c6ad25453c6be74bfd4cbdb7bc7eeed401c Mon Sep 17 00:00:00 2001 From: dingfei Date: Sat, 9 Nov 2024 10:28:59 +0800 Subject: [PATCH 1/4] [StaticAnalyzer] early return if sym is concrete on assuming Thi

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-13 Thread Ding Fei via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_analyze_cc1 %s \ +// RUN: -analyzer-checker=debug.ExprInspection \ +// RUN: -verify + +void clang_analyzer_eval(int); + +void test_derived_sym_simplification_on_assume(int s0, int s1) { + int elem = s0 + s1 + 1; + if (elem-- == 0) // elem = s

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-13 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/115579 >From 19b47c6ad25453c6be74bfd4cbdb7bc7eeed401c Mon Sep 17 00:00:00 2001 From: dingfei Date: Sat, 9 Nov 2024 10:28:59 +0800 Subject: [PATCH 1/3] [StaticAnalyzer] early return if sym is concrete on assuming Thi

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-12 Thread Ding Fei via cfe-commits
danix800 wrote: > First, let me thank you for posting a high quality patch like this. > > `ProgramState::isPosteriorlyOverconstrained()` was introduced to carry the > fact that even the parent state was infeasible. Checkers were written in the > sense that `ProgramState::assume()` will return

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-11 Thread Ding Fei via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_analyze_cc1 %s \ +// RUN: -analyzer-checker=unix.StdCLibraryFunctions \ +// RUN: -analyzer-config unix.StdCLibraryFunctions:ModelPOSIX=true \ +// RUN: -analyzer-checker=debug.ExprInspection \ +// RUN: -triple x86_64-unknown-linux-gnu \ +//

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-11 Thread Ding Fei via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_analyze_cc1 %s \ +// RUN: -analyzer-checker=debug.ExprInspection \ +// RUN: -verify + +void clang_analyzer_eval(int); + +void test_derived_sym_simplification_on_assume(int s0, int s1) { + int elem = s0 + s1 + 1; + if (elem-- == 0) // elem = s

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-11 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/115579 >From 19b47c6ad25453c6be74bfd4cbdb7bc7eeed401c Mon Sep 17 00:00:00 2001 From: dingfei Date: Sat, 9 Nov 2024 10:28:59 +0800 Subject: [PATCH 1/2] [StaticAnalyzer] early return if sym is concrete on assuming Thi

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-11 Thread Ding Fei via cfe-commits
danix800 wrote: > > Thanks for the commit, I'm satisfied with it :) > > I actually like that these two related changes (the checker change and the > > constraint manager improvement) are handled together in a single commit -- > > this way somebody who browses the commit log can directly see the

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-11 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/115579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-11 Thread Ding Fei via cfe-commits
@@ -23,7 +23,14 @@ RangedConstraintManager::~RangedConstraintManager() {} ProgramStateRef RangedConstraintManager::assumeSym(ProgramStateRef State, SymbolRef Sym, bool Assumpti

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-09 Thread Ding Fei via cfe-commits
danix800 wrote: Yes these two are related. Solver is the root cause, the checker crash is the effect. Either fix could cover the crash but not enough without the other. The solver is inherently incapable of solving some constraints, which would brings in some overly constrainted states. We co

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 unassigned https://github.com/llvm/llvm-project/pull/115579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/115579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/115579 This could deduce some complex syms derived from simple ones whose values could be constrainted to be concrete during execution, thus reducing some overconstrainted states. This commit also fix `unix.StdCLibr

[clang-tools-extra] [clang-query] add basic profiling on matching each ASTs (PR #114806)

2024-11-05 Thread Ding Fei via cfe-commits
https://github.com/danix800 closed https://github.com/llvm/llvm-project/pull/114806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-query] add basic profiling on matching each ASTs (PR #114806)

2024-11-04 Thread Ding Fei via cfe-commits
@@ -0,0 +1,35 @@ +//===- QueryProfile.h - clang-query -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-query] add basic profiling on matching each ASTs (PR #114806)

2024-11-04 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/114806 >From dfd42c06d94f859ec78ec1e5c3386c0e4016386f Mon Sep 17 00:00:00 2001 From: dingfei Date: Mon, 4 Nov 2024 22:37:51 +0800 Subject: [PATCH 1/6] [clang-query] add basic profiling on matching each ASTs Sample ou

[clang-tools-extra] [clang-query] add basic profiling on matching each ASTs (PR #114806)

2024-11-04 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/114806 >From dfd42c06d94f859ec78ec1e5c3386c0e4016386f Mon Sep 17 00:00:00 2001 From: dingfei Date: Mon, 4 Nov 2024 22:37:51 +0800 Subject: [PATCH 1/5] [clang-query] add basic profiling on matching each ASTs Sample ou

[clang-tools-extra] [clang-query] add basic profiling on matching each ASTs (PR #114806)

2024-11-04 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/114806 >From dfd42c06d94f859ec78ec1e5c3386c0e4016386f Mon Sep 17 00:00:00 2001 From: dingfei Date: Mon, 4 Nov 2024 22:37:51 +0800 Subject: [PATCH 1/4] [clang-query] add basic profiling on matching each ASTs Sample ou

[clang-tools-extra] [clang-query] add basic profiling on matching each ASTs (PR #114806)

2024-11-04 Thread Ding Fei via cfe-commits
@@ -0,0 +1,35 @@ +//===- QueryProfile.h - clang-query -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-query] add basic profiling on matching each ASTs (PR #114806)

2024-11-04 Thread Ding Fei via cfe-commits
@@ -0,0 +1,35 @@ +//===- QueryProfile.h - clang-query -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-query] add basic profiling on matching each ASTs (PR #114806)

2024-11-04 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/114806 >From dfd42c06d94f859ec78ec1e5c3386c0e4016386f Mon Sep 17 00:00:00 2001 From: dingfei Date: Mon, 4 Nov 2024 22:37:51 +0800 Subject: [PATCH 1/2] [clang-query] add basic profiling on matching each ASTs Sample ou

[clang-tools-extra] [clang-query] add basic profiling on matching each ASTs (PR #114806)

2024-11-04 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/114806 >From dfd42c06d94f859ec78ec1e5c3386c0e4016386f Mon Sep 17 00:00:00 2001 From: dingfei Date: Mon, 4 Nov 2024 22:37:51 +0800 Subject: [PATCH 1/3] [clang-query] add basic profiling on matching each ASTs Sample ou

[clang-tools-extra] [clang-query] add basic profiling on matching each ASTs (PR #114806)

2024-11-04 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/114806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-query] add basic profiling on matching each ASTs (PR #114806)

2024-11-04 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/114806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-query] add basic profiling on matching each ASTs (PR #114806)

2024-11-04 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/114806 Sample output: ``` $ cat test.cql set enable-profile true m binaryOperator(isExpansionInMainFile()) $ cat test.c int test(int i, int j) { return i + j; } $ clang-query --track-memory -f test.cql test.c --

[clang] [clang][AST] CXXRecords in anony namespace from diff TUs shouldn't be equivalent (PR #112534)

2024-10-18 Thread Ding Fei via cfe-commits
https://github.com/danix800 converted_to_draft https://github.com/llvm/llvm-project/pull/112534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST] CXXRecords in anony namespace from diff TUs shouldn't be equivalent (PR #112534)

2024-10-18 Thread Ding Fei via cfe-commits
danix800 wrote: > The fix looks acceptable, but a test is needed. The test code in the bug > report can be used somehow in at the AST merge LIT tests or in the > `ASTImporterTest`. Thanks for reviewing. There's one more other similar crash (with this fix) and I'm still reducing the testcase.

[clang] [clang][ASTImporter] set nonnull type for var specialized from lambda template (PR #105492)

2024-08-21 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/105492 >From 2ac3aa1b85d727fd15d49fa1649147f2229576cb Mon Sep 17 00:00:00 2001 From: dingfei Date: Wed, 21 Aug 2024 17:52:04 +0800 Subject: [PATCH 1/3] [clang][ASTImporter] set nonnull type for var specialized from l

[clang] [clang][ASTImporter] set nonnull type for var specialized from lambda template (PR #105492)

2024-08-21 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/105492 >From 2ac3aa1b85d727fd15d49fa1649147f2229576cb Mon Sep 17 00:00:00 2001 From: dingfei Date: Wed, 21 Aug 2024 17:52:04 +0800 Subject: [PATCH 1/2] [clang][ASTImporter] set nonnull type for var specialized from l

[clang] [clang][ASTImporter] New fix for default template parameter values. (PR #101836)

2024-08-21 Thread Ding Fei via cfe-commits
=?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -5968,11 +5962,21 @@ ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { } if (D->hasDefaultArgument()) { +// Default argument can be "inherited" when it has a reference to the +// previous d

[clang] [clang][ASTImporter] set nonnull type for var specialized from lambda template (PR #105492)

2024-08-21 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/105492 There's circular deps here when importing btw VarTemplateSpecializationDecl (m) and its type. VarDecl is created with a null type QualType(), and the importing of its type will leads to linkage computation (f

[clang] [clang][ASTImporter] Import C++20 concepts related nodes (PR #104731)

2024-08-18 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/104731 Related nodes including: - ConceptDecl - RequiresExprBodyDecl - ImplicitConceptSpecializationDecl - RequiresExpr - ConceptSpecializationExpr - concepts::Requirement - concepts::ExprRequirement - concepts::Neste

[clang] [clang][ASTMatcher] Add `matchesString` for `StringLiteral` which matches literals on given `RegExp` (PR #102152)

2024-08-07 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/102152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTMatcher] Add `matchesString` for `StringLiteral` which matches literals on given `RegExp` (PR #102152)

2024-08-07 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/102152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTMatcher] Add matcher for 'matches' (PR #102152)

2024-08-06 Thread Ding Fei via cfe-commits
@@ -288,6 +288,8 @@ AST Matchers - Fixed an issue with the `hasName` and `hasAnyName` matcher when matching inline namespaces with an enclosing namespace of the same name. +- Add ``matches``. danix800 wrote: ```suggestion - Add `matches` for `StringLiteral`

[clang] [clang][ASTMatcher] Add matcher for 'matches' (PR #102152)

2024-08-06 Thread Ding Fei via cfe-commits
@@ -5582,6 +5582,20 @@ Narrowing Matchers +MatcherStringLiteral>matchesStringRef RegExp, Regex::RegexFlags Flags = NoFlags danix800 wrote: ```suggestion Matcher

[clang] [clang][ASTImporter] support import return with UnaryTransformType (PR #101517)

2024-08-01 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/101517 This fixes infinite recursion crash on return with UnaryTransformType, whose underlying type is a SubstTemplateTypeParmType which is associated with current imported function. >From 3b787c88dafc287b9a5a7aea2afb

[clang] [clang][ASTImporter] Remove trailing return testing on lambda proto (PR #101031)

2024-07-31 Thread Ding Fei via cfe-commits
danix800 wrote: > > Here can `ToProcess.append(CurrentS->child_begin(), > > CurrentS->child_end());` add any nullptr into `ToProcess` in this testing > > context? > > I think it is possible, but I could not reproduce this case with the shown > code. We have over 30 C++ open-source projects (

[clang] [clang][ASTImporter] Remove trailing return testing on lambda proto (PR #101031)

2024-07-30 Thread Ding Fei via cfe-commits
danix800 wrote: > This commit surfaces another crash on null stmt inside > `CXXDeductionGuideDecl`: > > ```c > namespace foo { > template struct is_same; > template struct enable_if {}; > template > using enable_if_t = typename enable_if<_Cond, _Tp>::type; > > template > in

[clang] [clang][ASTImporter] Remove trailing return testing on lambda proto (PR #101031)

2024-07-30 Thread Ding Fei via cfe-commits
danix800 wrote: > > Another PR would fix the crash when this one is landed. > > Can you land the fix for the crash first? If the other PR gets reverted it > creates a lot of churn, so it would preferable to land that first. Assuming > it is not somehow dependent on this fix. This new crash is

[clang] [clang][ASTImporter] Remove trailing return testing on lambda proto (PR #101031)

2024-07-30 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/101031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Remove trailing return testing on lambda proto (PR #101031)

2024-07-30 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/101031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix typos in trailing return testing on lambda p… (PR #101031)

2024-07-30 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/101031 >From 35caf00e707b4fb2472d1409e34be7d20e4eeec2 Mon Sep 17 00:00:00 2001 From: dingfei Date: Mon, 29 Jul 2024 23:18:20 +0800 Subject: [PATCH] [clang][ASTImporter] Remove trailing return testing on lambda proto

[clang] [clang][ASTImporter] Fix typos in trailing return testing on lambda p… (PR #101031)

2024-07-30 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/101031 >From 1e832ad408710d8a896d64e01a9fbf8b9c7a7819 Mon Sep 17 00:00:00 2001 From: dingfei Date: Mon, 29 Jul 2024 23:18:20 +0800 Subject: [PATCH] [clang][ASTImporter] Remove trailing return testing on lambda proto

[clang] [clang][ASTImporter] Fix typos in trailing return testing on lambda p… (PR #101031)

2024-07-30 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/101031 >From 336bebf7d20feb7a6fab5ad038239b058f62bdfb Mon Sep 17 00:00:00 2001 From: dingfei Date: Mon, 29 Jul 2024 23:18:20 +0800 Subject: [PATCH 1/2] [clang][ASTImporter] Fix typos in trailing return testing on lam

[clang] [clang][ASTImporter] Fix typos in trailing return testing on lambda p… (PR #101031)

2024-07-30 Thread Ding Fei via cfe-commits
danix800 wrote: This commit surfaces another crash on null stmt inside `CXXDeductionGuideDecl`: ```c namespace foo { template struct is_same; template struct enable_if {}; template using enable_if_t = typename enable_if<_Cond, _Tp>::type; template inline constexpr bool is_sa

[clang] [clang][ASTImporter] Fix typos in trailing return testing on lambda p… (PR #101031)

2024-07-30 Thread Ding Fei via cfe-commits
https://github.com/danix800 ready_for_review https://github.com/llvm/llvm-project/pull/101031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix typos in trailing return testing on lambda p… (PR #101031)

2024-07-29 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/101031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix typos in trailing return testing on lambda p… (PR #101031)

2024-07-29 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/101031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix typos in trailing return testing on lambda p… (PR #101031)

2024-07-29 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/101031 …roto The test should be true on function with trailing return. This fixes crashes (infinite recursion) on lambda expr without parameters (without parentheses). >From 336bebf7d20feb7a6fab5ad038239b058f62bdfb

[clang] [clang][ASTImporter][NFC] add unittests for unnamed EnumDecl (PR #100545)

2024-07-25 Thread Ding Fei via cfe-commits
https://github.com/danix800 closed https://github.com/llvm/llvm-project/pull/100545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter][NFC] add unittests for unnamed EnumDecl (PR #100545)

2024-07-25 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/100545 These tests are for multiple anonymous EnumDecls structural eq test & importing. We found the anonymous enums importing issue a few days ago and tried to fix it but 0a6233a68c7b575d05bca0f0c708b7e97cc710d1 alre

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-19 Thread Ding Fei via cfe-commits
https://github.com/danix800 closed https://github.com/llvm/llvm-project/pull/89096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-18 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/89096 >From 0d6d52365a5d31045c347412c3a0fe8be7119006 Mon Sep 17 00:00:00 2001 From: dingfei Date: Thu, 18 Apr 2024 00:33:29 +0800 Subject: [PATCH 1/6] [ASTImporter] Fix infinite recurse on return type declared inside

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-18 Thread Ding Fei via cfe-commits
@@ -3647,15 +3647,28 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a declara

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/89096 >From 0d6d52365a5d31045c347412c3a0fe8be7119006 Mon Sep 17 00:00:00 2001 From: dingfei Date: Thu, 18 Apr 2024 00:33:29 +0800 Subject: [PATCH 1/5] [ASTImporter] Fix infinite recurse on return type declared inside

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/89096 >From 0d6d52365a5d31045c347412c3a0fe8be7119006 Mon Sep 17 00:00:00 2001 From: dingfei Date: Thu, 18 Apr 2024 00:33:29 +0800 Subject: [PATCH 1/4] [ASTImporter] Fix infinite recurse on return type declared inside

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/89096 >From 0d6d52365a5d31045c347412c3a0fe8be7119006 Mon Sep 17 00:00:00 2001 From: dingfei Date: Thu, 18 Apr 2024 00:33:29 +0800 Subject: [PATCH 1/3] [ASTImporter] Fix infinite recurse on return type declared inside

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
@@ -3647,15 +3647,19 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a declara

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/89096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
@@ -3647,15 +3647,19 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a declara

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
@@ -3647,15 +3647,19 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a declara

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
danix800 wrote: > I think it would be a good idea to double check this for performance > regressions, since this case will recurse into the function every time with > this patch. Though I don't know if there is a better way to test it than to > merge it and wait for it to be picked up by googl

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
@@ -3649,19 +3649,15 @@ class IsTypeDeclaredInsideVisitor /// This function checks if the function has 'auto' return type that contains /// a reference (in any way) to a declaration inside the same function. danix800 wrote: Thanks for reminding, fixed in htt

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/89096 >From 0d6d52365a5d31045c347412c3a0fe8be7119006 Mon Sep 17 00:00:00 2001 From: dingfei Date: Thu, 18 Apr 2024 00:33:29 +0800 Subject: [PATCH 1/2] [ASTImporter] Fix infinite recurse on return type declared inside

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/89096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/89096 >From 0d6d52365a5d31045c347412c3a0fe8be7119006 Mon Sep 17 00:00:00 2001 From: dingfei Date: Thu, 18 Apr 2024 00:33:29 +0800 Subject: [PATCH] [ASTImporter] Fix infinite recurse on return type declared inside bod

[clang] [llvm] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/89096 >From 0f7ddbfef8ca9c93efacfb2a437ddb5645ca07b1 Mon Sep 17 00:00:00 2001 From: dingfei Date: Thu, 18 Apr 2024 00:03:14 +0800 Subject: [PATCH] [ASTImporter] Fix infinite recurse on return type declared inside bod

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/89096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/89096 Lambda without trailing auto could has return type declared inside the body too. >From 6390eb0618e88c1c176329c6d49a45e16944f248 Mon Sep 17 00:00:00 2001 From: dingfei Date: Thu, 18 Apr 2024 00:03:14 +0800 Subje

[clang] [AST][RecoveryExpr] Fix a crash on c89/c90 invalid InitListExpr (#88008) (PR #88014)

2024-04-16 Thread Ding Fei via cfe-commits
https://github.com/danix800 closed https://github.com/llvm/llvm-project/pull/88014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST][RecoveryExpr] Fix a crash on c89/c90 invalid InitListExpr (#88008) (PR #88014)

2024-04-15 Thread Ding Fei via cfe-commits
@@ -13805,29 +13804,24 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { // OpenCL v1.2 s6.5.3: __constant locals must be constant-initialized. // This is true even in C++ for OpenCL. } else if (VDecl->getType().getAddressSpace() ==

[clang] [AST][RecoveryExpr] Fix a crash on c89/c90 invalid InitListExpr (#88008) (PR #88014)

2024-04-15 Thread Ding Fei via cfe-commits
@@ -3391,7 +3391,7 @@ class Sema final : public SemaBase { bool ConstexprSupported, bool CLinkageMayDiffer); /// type checking declaration initializers (C99 6.7.8) - bool CheckForConstantInitializer(Expr *e, QualType t); + bool CheckForConstantInitializer(Expr *Init,

[clang] [AST][RecoveryExpr] Fix a crash on c89/c90 invalid InitListExpr (#88008) (PR #88014)

2024-04-15 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/88014 >From 9b293d37ec5c0193e3ad4e1bab2d382ebe54d7b6 Mon Sep 17 00:00:00 2001 From: dingfei Date: Tue, 9 Apr 2024 00:26:03 +0800 Subject: [PATCH 1/3] [AST][RecoveryExpr] Fix a crash on c89/c90 invalid InitListExpr (#

[clang] [AST][RecoveryExpr] Fix a crash on c89/c90 invalid InitListExpr (#88008) (PR #88014)

2024-04-12 Thread Ding Fei via cfe-commits
danix800 wrote: ping @Endilll https://github.com/llvm/llvm-project/pull/88014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTMatchers] fix captureVars assertion failure on capturesVariables (PR #76619)

2024-04-09 Thread Ding Fei via cfe-commits
https://github.com/danix800 closed https://github.com/llvm/llvm-project/pull/76619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST][RecoveryExpr] Fix a crash on c89/c90 invalid InitListExpr (#88008) (PR #88014)

2024-04-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/88014 >From fbd0780923d40b0d8290280731239a722a7af7a9 Mon Sep 17 00:00:00 2001 From: dingfei Date: Tue, 9 Apr 2024 00:26:03 +0800 Subject: [PATCH 1/2] [AST][RecoveryExpr] Fix a crash on c89/c90 invalid InitListExpr (#

[clang] [ASTMatchers] fix captureVars assertion failure on capturesVariables (PR #76619)

2024-04-08 Thread Ding Fei via cfe-commits
danix800 wrote: > LGTM but please add a release note so users know about the bug fix. Release note added. https://github.com/llvm/llvm-project/pull/76619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [ASTMatchers] fix captureVars assertion failure on capturesVariables (PR #76619)

2024-04-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/76619 >From 0ca1a2b2573d1f89a1b4d13cd43628a46c1e5c98 Mon Sep 17 00:00:00 2001 From: dingfei Date: Sun, 31 Dec 2023 00:32:01 +0800 Subject: [PATCH] [ASTMatchers] fix captureVars assertion failure on capturesVariables

[clang] [AST][RecoveryExpr] Fix a crash on c89/c90 invalid InitListExpr (#88008) (PR #88014)

2024-04-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/88014 Use refactored `CheckForConstantInitializer()` to skip checking expr with error. >From fbd0780923d40b0d8290280731239a722a7af7a9 Mon Sep 17 00:00:00 2001 From: dingfei Date: Tue, 9 Apr 2024 00:26:03 +0800 Subjec

[clang] [clang][ASTImporter] fix assert fail due to offset overflow (PR #79084)

2024-01-29 Thread Ding Fei via cfe-commits
@@ -9896,9 +9903,13 @@ Expected ASTImporter::Import(FileID FromID, bool IsBuiltin) { // FIXME: The filename may be a virtual name that does probably not // point to a valid file and we get no Entry here. In this case try with // the memory buffer below

[clang] [clang][ASTImporter] fix assert fail due to offset overflow (PR #79084)

2024-01-29 Thread Ding Fei via cfe-commits
@@ -9896,9 +9903,13 @@ Expected ASTImporter::Import(FileID FromID, bool IsBuiltin) { // FIXME: The filename may be a virtual name that does probably not // point to a valid file and we get no Entry here. In this case try with // the memory buffer below

[clang] [clang][Parser] Pop scope prior VarDecl invalidating by invalid init (PR #77434)

2024-01-09 Thread Ding Fei via cfe-commits
https://github.com/danix800 closed https://github.com/llvm/llvm-project/pull/77434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Parser] Pop scope prior VarDecl invalidating by invalid init (PR #77434)

2024-01-09 Thread Ding Fei via cfe-commits
danix800 wrote: > This makes sense to me but I would like @cor3ntin to review as well. > > This needs a release note. Release note is added. > > I see that there was two test cases. Do you think it is worth it to add the > second test case as well? The original testcase from #30908 is added

[clang] [clang][Parser] Pop scope prior VarDecl invalidating by invalid init (PR #77434)

2024-01-09 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/77434 >From 2f9e45458d21952f9e81cd54297f538d1d04b9f9 Mon Sep 17 00:00:00 2001 From: dingfei Date: Tue, 9 Jan 2024 16:40:23 +0800 Subject: [PATCH] [clang][Parser] Pop scope prior VarDecl invalidating by invalid direct

[clang] [ASTMatchers] fix captureVars assertion failure on capturesVariables (PR #76619)

2024-01-09 Thread Ding Fei via cfe-commits
danix800 wrote: > Thank you for the fix, can you add more details to your summary. The summary > is what usually goes into the git log. We would like those to be as > descriptive as possible to avoid having to do extra digging to understand the > change at a high level. Thanks for reminding.

[clang] [ASTMatchers] fix captureVars assertion failure on capturesVariables (PR #76619)

2024-01-09 Thread Ding Fei via cfe-commits
https://github.com/danix800 edited https://github.com/llvm/llvm-project/pull/76619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTMatchers] fix captureVars assertion failure on capturesVariables (PR #76619)

2024-01-09 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/76619 >From 50c0ccd9a28896a1f8f673446054abd6f18703a9 Mon Sep 17 00:00:00 2001 From: dingfei Date: Sun, 31 Dec 2023 00:32:01 +0800 Subject: [PATCH] [ASTMatchers] fix captureVars assertion failure on capturesVariables

[clang] [clang][Parser] Pop scope prior VarDecl invalidating by invalid init (PR #77434)

2024-01-09 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/77434 Invalid (direct) initializer would invalid `VarDecl` so `InitializerScopeRAII` cannot restore scope stack balance. As with other kind of initializer, `InitializerScopeRAII::pop()` is moved up before `Sema::Act

[clang] [ASTMatchers] fix captureVars assertion failure on capturesVariables (PR #76619)

2023-12-30 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/76619 Fixes #76425 >From b26fa2acfd4974d1c09eef408b4d6c2dcbb16479 Mon Sep 17 00:00:00 2001 From: dingfei Date: Sun, 31 Dec 2023 00:32:01 +0800 Subject: [PATCH] [ASTMatchers] fix captureVars assertion failure on capt

  1   2   >