[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] [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] [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] [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-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-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] [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-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
@@ -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-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] [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] [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] [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 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] [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 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
@@ -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
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
@@ -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
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
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
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/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-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-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-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] [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][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] 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 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] 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][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] [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] 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] 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-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-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 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
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 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] 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] 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
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-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] 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][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][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 `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][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)

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] [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
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] [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] [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 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] [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

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-07 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/65448: >From 235f39a6a5137e53239105727798d4540e5dd563 Mon Sep 17 00:00:00 2001 From: dingfei Date: Wed, 6 Sep 2023 10:03:21 +0800 Subject: [PATCH 1/2] [analyzer] Reduce constraint on modulo with small concrete range

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-07 Thread Ding Fei via cfe-commits
https://github.com/danix800 unlabeled https://github.com/llvm/llvm-project/pull/65448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

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

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-07 Thread Ding Fei via cfe-commits
https://github.com/danix800 review_requested https://github.com/llvm/llvm-project/pull/65448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-07 Thread Ding Fei via cfe-commits
https://github.com/danix800 review_requested https://github.com/llvm/llvm-project/pull/65448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-07 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/65448: >From 235f39a6a5137e53239105727798d4540e5dd563 Mon Sep 17 00:00:00 2001 From: dingfei Date: Wed, 6 Sep 2023 10:03:21 +0800 Subject: [PATCH 1/2] [analyzer] Reduce constraint on modulo with small concrete range

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-07 Thread Ding Fei via cfe-commits
https://github.com/danix800 unlabeled https://github.com/llvm/llvm-project/pull/65448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 converted_to_draft https://github.com/llvm/llvm-project/pull/65448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/65448: >From 235f39a6a5137e53239105727798d4540e5dd563 Mon Sep 17 00:00:00 2001 From: dingfei Date: Wed, 6 Sep 2023 10:03:21 +0800 Subject: [PATCH 1/3] [analyzer] Reduce constraint on modulo with small concrete range

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 unlabeled https://github.com/llvm/llvm-project/pull/65448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/65448: >From 501595caf608aaeb8253235c32de5dd3ef4d3439 Mon Sep 17 00:00:00 2001 From: dingfei Date: Wed, 6 Sep 2023 10:03:21 +0800 Subject: [PATCH 1/3] [analyzer] Reduce constraint on modulo with small concrete range

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 unlabeled https://github.com/llvm/llvm-project/pull/65448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 review_requested https://github.com/llvm/llvm-project/pull/65448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-08 Thread Ding Fei via cfe-commits
https://github.com/danix800 ready_for_review https://github.com/llvm/llvm-project/pull/65448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66463)

2023-09-14 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/66463 NonLoc symbolic SVal to Loc casts are not supported except for nonloc::ConcreteInt. This change simplifies the source SVals so that the more casts can go through nonloc::ConcreteInt->loc::ConcreteInt path. For

[clang] [clang] fix lack comparison of declRefExpr in ASTStructuralEquivalence (PR #66041)

2023-09-15 Thread Ding Fei via cfe-commits
@@ -218,6 +218,8 @@ Bug Fixes in This Version (`#65156 `_) - Clang no longer considers the loss of ``__unaligned`` qualifier from objects as an invalid conversion during method function overload resolution. +- Fix lack of

[clang] [clang] fix lack comparison of declRefExpr in ASTStructuralEquivalence (PR #66041)

2023-09-15 Thread Ding Fei via cfe-commits
@@ -2320,5 +2320,14 @@ TEST_F(StructuralEquivalenceStmtTest, UnresolvedLookup) { EXPECT_TRUE(testStructuralMatch(t)); } +TEST_F(StructuralEquivalenceStmtTest, DeclRefENoEq) { danix800 wrote: ```suggestion TEST_F(StructuralEquivalenceStmtTest, DeclRefExpr) {

[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66463)

2023-09-15 Thread Ding Fei via cfe-commits
@@ -264,7 +264,8 @@ ProgramStateRef ExprEngine::handleLValueBitCast( } // Delegate to SValBuilder to process. SVal OrigV = state->getSVal(Ex, LCtx); - SVal V = svalBuilder.evalCast(OrigV, T, ExTy); + SVal SimplifiedOrigV = svalBuilder.simplifySVal(state, OrigV); + SVal

[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66463)

2023-09-15 Thread Ding Fei via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_analyze_cc1 %s \ +// RUN: -analyzer-checker=core \ +// RUN: -analyzer-checker=debug.ExprInspection \ +// RUN: -analyzer-config eagerly-assume=false \ +// RUN: -verify + +void clang_analyzer_eval(int); + +void test_simplified_before_cast_add

[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66463)

2023-09-15 Thread Ding Fei via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_analyze_cc1 %s \ +// RUN: -analyzer-checker=core \ +// RUN: -analyzer-checker=debug.ExprInspection \ +// RUN: -analyzer-config eagerly-assume=false \ +// RUN: -verify + +void clang_analyzer_eval(int); + +void test_simplified_before_cast_add

[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66463)

2023-09-15 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/66463 >From d48b57387e3dc1c2f3fdeae00fe1596b3466638d Mon Sep 17 00:00:00 2001 From: dingfei Date: Fri, 15 Sep 2023 14:01:26 +0800 Subject: [PATCH] [analyzer] Simplify SVal for simple NonLoc->Loc casts NonLoc symbolic

[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66498)

2023-09-15 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/66498 NonLoc symbolic SVal to Loc casts are not supported except for nonloc::ConcreteInt. This change simplifies the source SVals so that the more casts can go through nonloc::ConcreteInt->loc::ConcreteInt path. For

[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66463)

2023-09-15 Thread Ding Fei via cfe-commits
danix800 wrote: Fixed and resubmited #66498 https://github.com/llvm/llvm-project/pull/66463 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66498)

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

[clang] [clang][AST] fix lack comparison of declRefExpr in ASTStructuralEquivalence (PR #66041)

2023-09-15 Thread Ding Fei via cfe-commits
danix800 wrote: LGTM! If no further comment I'll merge this in a day or two. https://github.com/llvm/llvm-project/pull/66041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Simplify SVal for simple NonLoc->Loc casts (PR #66463)

2023-09-15 Thread Ding Fei via cfe-commits
danix800 wrote: `auto-merge` might be disabled probably. I can't find the button mentioned [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request). https://github.com/llvm/llvm-project/pull/

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-15 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/65448 >From 111de0e99482cf8c8c206286bb9a4f40149992c6 Mon Sep 17 00:00:00 2001 From: dingfei Date: Wed, 6 Sep 2023 10:03:21 +0800 Subject: [PATCH] [analyzer] Improve constraint inferring on concrete div/mod 1. Reduce

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

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

[clang] [analyzer] Improve constraint inferring on concrete div/mod (PR #65448)

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

[clang] [analyzer] Improve constraint inferring on concrete div/mod (PR #65448)

2023-09-15 Thread Ding Fei via cfe-commits
@@ -1824,6 +1835,94 @@ RangeSet SymbolicRangeInferrer::VisitBinaryOperator(Range LHS, return {RangeFactory, ValueFactory.getValue(Min), ValueFactory.getValue(Max)}; } +RangeSet SymbolicRangeInferrer::handleConcreteModulo(Range LHS, +

[clang] [analyzer] Improve constraint inferring on concrete div/mod (PR #65448)

2023-09-15 Thread Ding Fei via cfe-commits
@@ -1824,6 +1835,94 @@ RangeSet SymbolicRangeInferrer::VisitBinaryOperator(Range LHS, return {RangeFactory, ValueFactory.getValue(Min), ValueFactory.getValue(Max)}; } +RangeSet SymbolicRangeInferrer::handleConcreteModulo(Range LHS, +

[clang] [analyzer] Improve constraint inferring on concrete div/mod (PR #65448)

2023-09-15 Thread Ding Fei via cfe-commits
danix800 wrote: > Uh, this isn't my expertiese. I'm a bit scared to do this alone. I'm also > short on time to verify this patch at scale. Look forward to hear more advice! @llvm/pr-subscribers-clang-static-analyzer https://github.com/llvm/llvm-project/pull/65448 _

[clang] [clang][ASTImporter] Fix crash when template class static member imported to other translation unit. (PR #68774)

2023-10-12 Thread Ding Fei via cfe-commits
danix800 wrote: Caused by missing `MemberSpecializationInfo` when importing so moving testcase into `ASTImporterTest` as unittest would be better. https://github.com/llvm/llvm-project/pull/68774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy][misc-include-cleaner]Avoid to insert same include header multiple times (PR #65431)

2023-09-05 Thread Ding Fei via cfe-commits
danix800 wrote: Please refer to https://reviews.llvm.org/D159263 about `areDiagsSelfContained`. https://github.com/llvm/llvm-project/pull/65431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang-tools-extra] [clang-tidy][misc-include-cleaner]Avoid to insert same include header multiple times (PR #65431)

2023-09-05 Thread Ding Fei via cfe-commits
@@ -199,6 +199,9 @@ void IncludeCleanerCheck::check(const MatchFinder::MatchResult &Result) { tooling::HeaderIncludes HeaderIncludes(getCurrentMainFile(), Code, FileStyle->IncludeStyle); + // `tooling::HeaderIncludes::insert` will n

[clang-tools-extra] [clang-tidy][misc-include-cleaner]Avoid to insert same include header multiple times (PR #65431)

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

[clang-tools-extra] [clang-tidy][misc-include-cleaner]Avoid to insert same include header multiple times (PR #65431)

2023-09-05 Thread Ding Fei via cfe-commits
@@ -209,14 +212,16 @@ void IncludeCleanerCheck::check(const MatchFinder::MatchResult &Result) { // main file. if (auto Replacement = HeaderIncludes.insert(llvm::StringRef{Spelling}.trim("\"<>"), danix800 wrote: `HeaderIncludes` is NOT a co

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-06 Thread Ding Fei via cfe-commits
https://github.com/danix800 created https://github.com/llvm/llvm-project/pull/65448: Fixes #54377 >From 2b04f714f1e1985546ff7ed00c131591316782b8 Mon Sep 17 00:00:00 2001 From: dingfei Date: Wed, 6 Sep 2023 10:03:21 +0800 Subject: [PATCH] [analyzer] Reduce constraint on modulo with small concre

[clang] [analyzer] Reduce constraint on modulo with small concrete range (PR #65448)

2023-09-06 Thread Ding Fei via cfe-commits
https://github.com/danix800 updated https://github.com/llvm/llvm-project/pull/65448: >From 235f39a6a5137e53239105727798d4540e5dd563 Mon Sep 17 00:00:00 2001 From: dingfei Date: Wed, 6 Sep 2023 10:03:21 +0800 Subject: [PATCH] [analyzer] Reduce constraint on modulo with small concrete range ---

  1   2   >