[clang-tools-extra] 15dfe7a - [clangd] Fix a typo , => ; in hovertest.

2022-01-27 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-27T22:19:09+01:00 New Revision: 15dfe7a3f12c4862999e275195a14ef746ab975a URL: https://github.com/llvm/llvm-project/commit/15dfe7a3f12c4862999e275195a14ef746ab975a DIFF: https://github.com/llvm/llvm-project/commit/15dfe7a3f12c4862999e275195a14ef746ab975a.diff LO

[clang] a2fab82 - [pseudo] Implement LRTable.

2022-02-23 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-02-23T09:21:34+01:00 New Revision: a2fab82f33bb8cc38cd1dfe7856dae706ce4297a URL: https://github.com/llvm/llvm-project/commit/a2fab82f33bb8cc38cd1dfe7856dae706ce4297a DIFF: https://github.com/llvm/llvm-project/commit/a2fab82f33bb8cc38cd1dfe7856dae706ce4297a.diff LO

[clang] 302ca27 - [pseudo] fix an out-of-bound error in LRTable.

2022-02-23 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-02-23T21:34:54+01:00 New Revision: 302ca279cb83043ef7d60115eb5ba58f12064a4a URL: https://github.com/llvm/llvm-project/commit/302ca279cb83043ef7d60115eb5ba58f12064a4a DIFF: https://github.com/llvm/llvm-project/commit/302ca279cb83043ef7d60115eb5ba58f12064a4a.diff LO

[clang] 28efb1c - [pseudo] Fix an out-of-bound error in LRTable::find.

2022-03-02 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-03-02T09:53:52+01:00 New Revision: 28efb1ccf5eabd25119a3a7df2c2c1f1407dbfec URL: https://github.com/llvm/llvm-project/commit/28efb1ccf5eabd25119a3a7df2c2c1f1407dbfec DIFF: https://github.com/llvm/llvm-project/commit/28efb1ccf5eabd25119a3a7df2c2c1f1407dbfec.diff LO

[clang] 7f99e18 - [pseudo] Add a print-grammar option in the tool

2022-03-02 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-03-02T10:05:49+01:00 New Revision: 7f99e1870f776a25e03526e3190105c094750d98 URL: https://github.com/llvm/llvm-project/commit/7f99e1870f776a25e03526e3190105c094750d98 DIFF: https://github.com/llvm/llvm-project/commit/7f99e1870f776a25e03526e3190105c094750d98.diff LO

[clang] 05d7e9f - [pseudo] fix some comment nits, NFC.

2022-03-02 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-03-02T10:19:17+01:00 New Revision: 05d7e9f68ef005c43576278fe5d7ac03869974f3 URL: https://github.com/llvm/llvm-project/commit/05d7e9f68ef005c43576278fe5d7ac03869974f3 DIFF: https://github.com/llvm/llvm-project/commit/05d7e9f68ef005c43576278fe5d7ac03869974f3.diff LO

[clang] ba6c71b - [AST] Use RecoveryExpr to model a DeclRefExpr which refers to an invalid Decl.

2022-03-03 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-03-03T10:33:40+01:00 New Revision: ba6c71b1377e8c99b62b2115a8519df74465f53c URL: https://github.com/llvm/llvm-project/commit/ba6c71b1377e8c99b62b2115a8519df74465f53c DIFF: https://github.com/llvm/llvm-project/commit/ba6c71b1377e8c99b62b2115a8519df74465f53c.diff LO

[clang] 28ccf32 - [pseudo] Fix an out-of-bound access for LRTable::Actions.

2022-03-03 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-03-03T14:27:44+01:00 New Revision: 28ccf326725d0fea8648834c8acdbdfe3aa40d7a URL: https://github.com/llvm/llvm-project/commit/28ccf326725d0fea8648834c8acdbdfe3aa40d7a DIFF: https://github.com/llvm/llvm-project/commit/28ccf326725d0fea8648834c8acdbdfe3aa40d7a.diff LO

[clang] d5b8ecb - [pseudo] empty parameter-declaration should be allowed in lambda declarator.

2022-03-07 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-03-07T20:05:35+01:00 New Revision: d5b8ecbd33c95d9a6ac8371d5dc187196b71604d URL: https://github.com/llvm/llvm-project/commit/d5b8ecbd33c95d9a6ac8371d5dc187196b71604d DIFF: https://github.com/llvm/llvm-project/commit/d5b8ecbd33c95d9a6ac8371d5dc187196b71604d.diff LO

[clang] 2d01ac1 - [pseudo] Strip comments for TokenStream.

2022-03-07 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-03-07T20:24:37+01:00 New Revision: 2d01ac18df93f2f8dd925888aabb7681224fb670 URL: https://github.com/llvm/llvm-project/commit/2d01ac18df93f2f8dd925888aabb7681224fb670 DIFF: https://github.com/llvm/llvm-project/commit/2d01ac18df93f2f8dd925888aabb7681224fb670.diff LO

[clang-tools-extra] 20f8f46 - [clangd] Fix selection on multi-dimensional array.

2022-01-04 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-04T11:53:42+01:00 New Revision: 20f8f46c60b39fb2c6b4371a03e580d0711e8d82 URL: https://github.com/llvm/llvm-project/commit/20f8f46c60b39fb2c6b4371a03e580d0711e8d82 DIFF: https://github.com/llvm/llvm-project/commit/20f8f46c60b39fb2c6b4371a03e580d0711e8d82.diff LO

[clang-tools-extra] cb9ccd3 - [clangd] Move the selection decltype hack to getSourceRange.

2022-01-04 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-04T12:11:58+01:00 New Revision: cb9ccd38c55f729a6bd7986bbdcb34755b774240 URL: https://github.com/llvm/llvm-project/commit/cb9ccd38c55f729a6bd7986bbdcb34755b774240 DIFF: https://github.com/llvm/llvm-project/commit/cb9ccd38c55f729a6bd7986bbdcb34755b774240.diff LO

[clang-tools-extra] 7632d19 - [clangd] Fix typos in the SelectionTree comment.

2022-01-05 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-05T15:50:07+01:00 New Revision: 7632d19ada4a1feebc4a06067490ee1c77cd4dc1 URL: https://github.com/llvm/llvm-project/commit/7632d19ada4a1feebc4a06067490ee1c77cd4dc1 DIFF: https://github.com/llvm/llvm-project/commit/7632d19ada4a1feebc4a06067490ee1c77cd4dc1.diff LO

[clang] 4a4b8e4 - [AST] Add more source information for DecltypeTypeLoc.

2022-01-10 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-10T09:34:18+01:00 New Revision: 4a4b8e4f99e2a82286b0595d561a51e7ad1945d2 URL: https://github.com/llvm/llvm-project/commit/4a4b8e4f99e2a82286b0595d561a51e7ad1945d2 DIFF: https://github.com/llvm/llvm-project/commit/4a4b8e4f99e2a82286b0595d561a51e7ad1945d2.diff LO

[clang] abe3003 - [AST] Use recovery-expr to preserve incomplete-type-member-access expression.

2022-01-10 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-10T12:45:20+01:00 New Revision: abe3003ead808518190d1e9717495735786938d3 URL: https://github.com/llvm/llvm-project/commit/abe3003ead808518190d1e9717495735786938d3 DIFF: https://github.com/llvm/llvm-project/commit/abe3003ead808518190d1e9717495735786938d3.diff LO

[clang] 55d96ac - [AST] Add RParen loc for decltype AutoTypeloc.

2022-01-10 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-10T12:46:27+01:00 New Revision: 55d96ac3dc56bdebea854952a724c2a50d96ce19 URL: https://github.com/llvm/llvm-project/commit/55d96ac3dc56bdebea854952a724c2a50d96ce19 DIFF: https://github.com/llvm/llvm-project/commit/55d96ac3dc56bdebea854952a724c2a50d96ce19.diff LO

[clang-tools-extra] 37ec65e - [clangd] Enable expand-auto for decltype(auto).

2022-01-10 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-10T13:46:56+01:00 New Revision: 37ec65e1d705f56fe5551de1dfcbac1e071588a2 URL: https://github.com/llvm/llvm-project/commit/37ec65e1d705f56fe5551de1dfcbac1e071588a2 DIFF: https://github.com/llvm/llvm-project/commit/37ec65e1d705f56fe5551de1dfcbac1e071588a2.diff LO

[clang] c2293bc - Revert "[AST] Add RParen loc for decltype AutoTypeloc."

2022-01-10 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-10T15:18:41+01:00 New Revision: c2293bc17dd09d552c5fdd13ff2b7c5738c5a10a URL: https://github.com/llvm/llvm-project/commit/c2293bc17dd09d552c5fdd13ff2b7c5738c5a10a DIFF: https://github.com/llvm/llvm-project/commit/c2293bc17dd09d552c5fdd13ff2b7c5738c5a10a.diff LO

[clang-tools-extra] 41fbdfa - Reland "[AST] Add RParen loc for decltype AutoTypeloc."

2022-01-11 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-11T12:06:18+01:00 New Revision: 41fbdfa4d5601cccbcdc0ded8ef35190d502f7f3 URL: https://github.com/llvm/llvm-project/commit/41fbdfa4d5601cccbcdc0ded8ef35190d502f7f3 DIFF: https://github.com/llvm/llvm-project/commit/41fbdfa4d5601cccbcdc0ded8ef35190d502f7f3.diff LO

[clang-tools-extra] 64c108c - [clangd] Better handling `\n` in the synthesized diagnostic message.

2022-01-17 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-17T09:27:58+01:00 New Revision: 64c108c9e4e0525328ceb4da55e4ab4b765d4c27 URL: https://github.com/llvm/llvm-project/commit/64c108c9e4e0525328ceb4da55e4ab4b765d4c27 DIFF: https://github.com/llvm/llvm-project/commit/64c108c9e4e0525328ceb4da55e4ab4b765d4c27.diff LO

[clang-tools-extra] 8848324 - [clangd] Avoid a code completion crash

2022-01-17 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-17T10:35:55+01:00 New Revision: 884832407e47579a28e8c363492a620901f2eab4 URL: https://github.com/llvm/llvm-project/commit/884832407e47579a28e8c363492a620901f2eab4 DIFF: https://github.com/llvm/llvm-project/commit/884832407e47579a28e8c363492a620901f2eab4.diff LO

[clang-tools-extra] ab3f100 - Reland (2) "[AST] Add RParen loc for decltype AutoTypeloc.""

2022-01-17 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-17T11:33:11+01:00 New Revision: ab3f100bec03d72ecee947a323c51698d4b95207 URL: https://github.com/llvm/llvm-project/commit/ab3f100bec03d72ecee947a323c51698d4b95207 DIFF: https://github.com/llvm/llvm-project/commit/ab3f100bec03d72ecee947a323c51698d4b95207.diff LO

[clang-tools-extra] 192f8d9 - [clangd] Don't rename on symbols from system headers.

2022-01-17 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2022-01-17T15:08:53+01:00 New Revision: 192f8d97002f13ab5a74ee11c4d5559b5ca693a8 URL: https://github.com/llvm/llvm-project/commit/192f8d97002f13ab5a74ee11c4d5559b5ca693a8 DIFF: https://github.com/llvm/llvm-project/commit/192f8d97002f13ab5a74ee11c4d5559b5ca693a8.diff LO

[clang-tools-extra] b7d2d14 - [clangd] Disable the NOLINTBBEGIN testcase in clangd.

2021-12-15 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2021-12-15T11:32:27+01:00 New Revision: b7d2d147477e4fa5e34a3bb74b2a393cdaab9779 URL: https://github.com/llvm/llvm-project/commit/b7d2d147477e4fa5e34a3bb74b2a393cdaab9779 DIFF: https://github.com/llvm/llvm-project/commit/b7d2d147477e4fa5e34a3bb74b2a393cdaab9779.diff LO

[clang] cfc36bf - [clang] Treat variable-length array of incomplete element type as

2021-03-24 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2021-03-24T14:22:15+01:00 New Revision: cfc36bf0179435ecbd489761bd7d5dae00846c87 URL: https://github.com/llvm/llvm-project/commit/cfc36bf0179435ecbd489761bd7d5dae00846c87 DIFF: https://github.com/llvm/llvm-project/commit/cfc36bf0179435ecbd489761bd7d5dae00846c87.diff LO

[clang-tools-extra] b83b7d0 - [clangd] NFC, avoid potential ODR violation.

2021-01-08 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2021-01-08T13:29:11+01:00 New Revision: b83b7d08730e2b67d911653f59091b1b311c0213 URL: https://github.com/llvm/llvm-project/commit/b83b7d08730e2b67d911653f59091b1b311c0213 DIFF: https://github.com/llvm/llvm-project/commit/b83b7d08730e2b67d911653f59091b1b311c0213.diff LO

[clang-tools-extra] c909512 - [clangd] Cleanup a remaining Optional usage, NFC.

2021-01-08 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2021-01-08T13:44:20+01:00 New Revision: c909512fdb9ed63081b0578410430117811b86e8 URL: https://github.com/llvm/llvm-project/commit/c909512fdb9ed63081b0578410430117811b86e8 DIFF: https://github.com/llvm/llvm-project/commit/c909512fdb9ed63081b0578410430117811b86e8.diff LO

[clang-tools-extra] ed3b1f9 - [clangd] go-to-implementation on a base class jumps to all subclasses.

2021-01-08 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2021-01-08T13:50:57+01:00 New Revision: ed3b1f906115a0dcd2542fa294d0382a42eb177d URL: https://github.com/llvm/llvm-project/commit/ed3b1f906115a0dcd2542fa294d0382a42eb177d DIFF: https://github.com/llvm/llvm-project/commit/ed3b1f906115a0dcd2542fa294d0382a42eb177d.diff LO

[clang-tools-extra] 8e36d21 - [clangd] Add go-to-def metric.

2021-01-08 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2021-01-08T21:03:59+01:00 New Revision: 8e36d21fabcd23835d17855025d06946eb0dfb9b URL: https://github.com/llvm/llvm-project/commit/8e36d21fabcd23835d17855025d06946eb0dfb9b DIFF: https://github.com/llvm/llvm-project/commit/8e36d21fabcd23835d17855025d06946eb0dfb9b.diff LO

[clang-tools-extra] 1677c86 - [clangd] Add metrics for go-to-implementation.

2021-01-11 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2021-01-11T10:26:50+01:00 New Revision: 1677c86124e5b82a8dbf991f2d5fc450d06db4ad URL: https://github.com/llvm/llvm-project/commit/1677c86124e5b82a8dbf991f2d5fc450d06db4ad DIFF: https://github.com/llvm/llvm-project/commit/1677c86124e5b82a8dbf991f2d5fc450d06db4ad.diff LO

[clang-tools-extra] a2dbf34 - [clangd] Fix -check mode doesn't respect any tidy configs.

2021-01-11 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2021-01-11T16:43:33+01:00 New Revision: a2dbf3443af79426c80e8a808821236c5a2b305e URL: https://github.com/llvm/llvm-project/commit/a2dbf3443af79426c80e8a808821236c5a2b305e DIFF: https://github.com/llvm/llvm-project/commit/a2dbf3443af79426c80e8a808821236c5a2b305e.diff LO

[clang-tools-extra] 42830f8 - [clangd] Extend find-refs to include overrides.

2021-01-20 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2021-01-20T13:23:20+01:00 New Revision: 42830f8bdc8f064fee648541f79f8e8d66072cce URL: https://github.com/llvm/llvm-project/commit/42830f8bdc8f064fee648541f79f8e8d66072cce DIFF: https://github.com/llvm/llvm-project/commit/42830f8bdc8f064fee648541f79f8e8d66072cce.diff LO

[clang-tools-extra] facea4a - [clangd] Fix a missing override keyword, NFC.

2021-01-21 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2021-01-21T11:06:43+01:00 New Revision: facea4a2d4fa543da2241fb4268c34e9c019fca6 URL: https://github.com/llvm/llvm-project/commit/facea4a2d4fa543da2241fb4268c34e9c019fca6 DIFF: https://github.com/llvm/llvm-project/commit/facea4a2d4fa543da2241fb4268c34e9c019fca6.diff LO

[clang] 6e63f96 - [Parse] Improve diagnostic and recovery when there is an extra override in the outline method definition.

2021-10-18 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2021-10-18T10:00:21+02:00 New Revision: 6e63f96e11ee9af300b166c994980d3b80cea0c7 URL: https://github.com/llvm/llvm-project/commit/6e63f96e11ee9af300b166c994980d3b80cea0c7 DIFF: https://github.com/llvm/llvm-project/commit/6e63f96e11ee9af300b166c994980d3b80cea0c7.diff LO

[clang] [clang] Emit -Wdangling diagnoses for cases where a gsl-pointer is construct from a gsl-owner object in a container. (PR #104556)

2024-08-19 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/104556 >From e0f1fca3cb2d0d7b3476913c20755219aa47c0af Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Mon, 19 Aug 2024 13:46:16 +0200 Subject: [PATCH] [clang] Diagnose dangling issues for cases where a gsl-pointer is c

[clang] [clang] Emit -Wdangling diagnoses for cases where a gsl-pointer is construct from a gsl-owner object in a container. (PR #104556)

2024-08-19 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/104556 >From ea86000bcba54e542a9a0f940451f15ac521e32b Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Mon, 19 Aug 2024 13:46:16 +0200 Subject: [PATCH] [clang] Diagnose dangling issues for cases where a gsl-pointer is c

[clang] [clang] Emit -Wdangling diagnoses for cases where a gsl-pointer is construct from a gsl-owner object in a container. (PR #104556)

2024-08-19 Thread Haojian Wu via cfe-commits
hokein wrote: I've refined the PR, and the new implementation eliminates the false positive mentioned above (I've also added a few more tests to verify this). Please take a look. The changes include some refactoring (I'm happy to split those out if they make the review process harder). https:

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-20 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/104906 In the current lifetime analysis, we have two parallel code paths: one for lifetimebound and another for GSL. These paths perform the same logic, both determining whether to continue visiting subexpressions. Th

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-20 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/104906 >From 773a03b25a94d991206f4b517eefdf3693e6a287 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 20 Aug 2024 10:22:44 +0200 Subject: [PATCH 1/2] [clang] Merge the lifetimebound and GSL code paths for lifetime

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-20 Thread Haojian Wu via cfe-commits
@@ -478,13 +449,32 @@ static void visitLifetimeBoundArguments(IndirectLocalPath &Path, Expr *Call, CheckCoroObjArg = false; if (implicitObjectParamIsLifetimeBound(Callee) || CheckCoroObjArg) VisitLifetimeBoundArg(Callee, ObjectArg); +else if (EnableLifetime

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-20 Thread Haojian Wu via cfe-commits
@@ -478,13 +449,32 @@ static void visitLifetimeBoundArguments(IndirectLocalPath &Path, Expr *Call, CheckCoroObjArg = false; if (implicitObjectParamIsLifetimeBound(Callee) || CheckCoroObjArg) VisitLifetimeBoundArg(Callee, ObjectArg); +else if (EnableLifetime

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-21 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/104906 >From 773a03b25a94d991206f4b517eefdf3693e6a287 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 20 Aug 2024 10:22:44 +0200 Subject: [PATCH 1/3] [clang] Merge the lifetimebound and GSL code paths for lifetime

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-21 Thread Haojian Wu via cfe-commits
@@ -439,6 +378,8 @@ static void visitLifetimeBoundArguments(IndirectLocalPath &Path, Expr *Call, if (!Callee) return; + bool EnableGSLAnalysis = !Callee->getASTContext().getDiagnostics().isIgnored( hokein wrote: > Can we move this to VisitGSLPointerAr

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-21 Thread Haojian Wu via cfe-commits
@@ -478,22 +444,38 @@ static void visitLifetimeBoundArguments(IndirectLocalPath &Path, Expr *Call, CheckCoroObjArg = false; if (implicitObjectParamIsLifetimeBound(Callee) || CheckCoroObjArg) VisitLifetimeBoundArg(Callee, ObjectArg); +else if (EnableGSLAnaly

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-22 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/104906 >From d4778d06b71b34aa178ae7482c15a8e00d9f3f19 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 20 Aug 2024 10:22:44 +0200 Subject: [PATCH 1/4] [clang] Merge the lifetimebound and GSL code paths for lifetime

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-22 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/104906 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-22 Thread Haojian Wu via cfe-commits
hokein wrote: Sorry for the breakage, and thanks for the revert. This is not expected, I will take a look. https://github.com/llvm/llvm-project/pull/104906 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-23 Thread Haojian Wu via cfe-commits
hokein wrote: The removal of `EnableLifetimeWarnings` flag causes some behavior change when we visit a lifetimebound function argument: - before: the `EnableLifetimeWarnings` is always `false`, which means we never run into the GSL codepath - after: we remove this flag, we will continue to run

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-23 Thread Haojian Wu via cfe-commits
hokein wrote: Reduced the libcxx failure to: ``` std::string_view test() { return std::move(*std::optional()); } ``` We should not diagnose on this case. I think the PR https://github.com/llvm/llvm-project/pull/104556 should fix this. https://github.com/llvm/llvm-project/pull/104906 ___

[clang] [clang] Merge lifetimebound and GSL code paths for lifetime analysis (PR #104906)

2024-08-23 Thread Haojian Wu via cfe-commits
hokein wrote: > I think the PR https://github.com/llvm/llvm-project/pull/104556 should fix > this. The PRdoesn't address this issue, it appears to be a different problem. I have identified the correct solution, so my plan is as follows: 1. Reland this PR without removing EnableLifetimeWarning

[clang] Re-land "[clang] Merge lifetimebound and GSL code paths for li… (PR #105753)

2024-08-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/105753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Re-land "[clang] Merge lifetimebound and GSL code paths for li… (PR #105753)

2024-08-23 Thread Haojian Wu via cfe-commits
hokein wrote: Thanks, acked. Closing it now. I will reland it. https://github.com/llvm/llvm-project/pull/105753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland "[clang] Merge lifetimebound and GSL code paths for lifetime analysis (#104906)" (PR #105838)

2024-08-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/105838 Reland without the `EnableLifetimeWarnings` removal. I will remove the EnableLifetimeWarnings in a follow-up patch. I have added a test to prevent regression. >From c248c80164965e82807a8682d30ce387f7801cc4 Mon

[clang] Reland "[clang] Merge lifetimebound and GSL code paths for lifetime analysis (#104906)" (PR #105838)

2024-08-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/105838 >From c248c80164965e82807a8682d30ce387f7801cc4 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 23 Aug 2024 16:20:45 +0200 Subject: [PATCH 1/2] Reland "[clang] Merge lifetimebound and GSL code paths for life

[clang] Reland "[clang] Merge lifetimebound and GSL code paths for lifetime analysis (#104906)" (PR #105838)

2024-08-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/105838 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] d86349c - Fix some warnings in SemaHLSL.cpp.

2024-08-23 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2024-08-23T20:02:37+02:00 New Revision: d86349cf40196bc7f52e3f294ed2afafacadf1f5 URL: https://github.com/llvm/llvm-project/commit/d86349cf40196bc7f52e3f294ed2afafacadf1f5 DIFF: https://github.com/llvm/llvm-project/commit/d86349cf40196bc7f52e3f294ed2afafacadf1f5.diff LO

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/105884 Reland the remaining change of https://github.com/llvm/llvm-project/pull/104906, with a proper fix for the regression. >From 82069c8eb2c31734ce149b510317cded04b3835e Mon Sep 17 00:00:00 2001 From: Haojian Wu D

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-23 Thread Haojian Wu via cfe-commits
@@ -393,11 +392,9 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call, Path.push_back({IndirectLocalPathEntry::LifetimeBoundCall, Arg, D}); if (Arg->isGLValue()) visitLocalsRetainedByReferenceBinding(Path, Arg, RK_ReferenceBinding, -

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-08-26 Thread Haojian Wu via cfe-commits
@@ -5346,7 +5346,6 @@ static EvalStmtResult EvaluateStmt(StmtResult &Result, EvalInfo &Info, const Expr *RetExpr = cast(S)->getRetValue(); FullExpressionRAII Scope(Info); if (RetExpr && RetExpr->isValueDependent()) { - EvaluateDependentExpr(RetExpr, Info); ---

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Haojian Wu via cfe-commits
@@ -461,15 +457,15 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call, I != N; ++I) { if (CheckCoroCall || Callee->getParamDecl(I)->hasAttr()) VisitLifetimeBoundArg(Callee->getParamDecl(I), Args[I]); -else if (EnableLifetimeWarni

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/105884 >From 82069c8eb2c31734ce149b510317cded04b3835e Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 23 Aug 2024 21:42:20 +0200 Subject: [PATCH 1/2] [clang] Remove the EnableLifetimeWarnings flag in lifetime anal

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Haojian Wu via cfe-commits
@@ -408,7 +405,8 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call, // Once we initialized a value with a reference, it can no longer dangle. if (!Value) { for (const IndirectLocalPathEntry &PE : llvm::reverse(Path)) { -if (PE.

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/105884 >From 0f8a051930491b33181bfc4e27320f0a6f31786c Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 23 Aug 2024 21:42:20 +0200 Subject: [PATCH 1/3] [clang] Remove the EnableLifetimeWarnings flag in lifetime anal

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/105884 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-24 Thread Haojian Wu via cfe-commits
@@ -12114,6 +12115,35 @@ static void NoteFunctionCandidate(Sema &S, OverloadCandidate *Cand, return; } + // If this is an implicit deduction guide against an implicitly defined + // constructor, add a note for it. Neither these deduction guides nor their + // corresp

[clang] f09b024 - [clang] Remove a stale FIXME

2024-06-25 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2024-06-25T11:45:25+02:00 New Revision: f09b02484b865e4e6e2243ee2ff59d70b60d28e4 URL: https://github.com/llvm/llvm-project/commit/f09b02484b865e4e6e2243ee2ff59d70b60d28e4 DIFF: https://github.com/llvm/llvm-project/commit/f09b02484b865e4e6e2243ee2ff59d70b60d28e4.diff LO

[clang] [clang] CTAD: Generate deduction guides for alias templates from non-template explicit deduction guides (PR #96686)

2024-06-25 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/96686 This patch addresses an issue where non-template explicit deduction guides were not considered when synthesized the deduction guides for alias templates. Fixes #94927. >From 92f9733b620f8d15283c520adceae161b11e

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-26 Thread Haojian Wu via cfe-commits
https://github.com/hokein commented: Thanks, this looks good overall. https://github.com/llvm/llvm-project/pull/96084 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-26 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/96084 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-26 Thread Haojian Wu via cfe-commits
@@ -108,8 +108,11 @@ struct Foo { Foo(T const (&)[N]); }; +// FIXME: Prefer non-canonical template arguments in the deduction guide? template using Bar = Foo; // expected-note {{candidate template ignored: couldn't infer template argument 'X'}} \ +

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-26 Thread Haojian Wu via cfe-commits
@@ -108,8 +108,11 @@ struct Foo { Foo(T const (&)[N]); }; +// FIXME: Prefer non-canonical template arguments in the deduction guide? hokein wrote: We have a open bug for this, https://github.com/llvm/llvm-project/issues/79798. https://github.com/llvm/llvm-

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-26 Thread Haojian Wu via cfe-commits
@@ -108,8 +108,11 @@ struct Foo { Foo(T const (&)[N]); }; +// FIXME: Prefer non-canonical template arguments in the deduction guide? template using Bar = Foo; // expected-note {{candidate template ignored: couldn't infer template argument 'X'}} \ +

[clang] [clang] CTAD: Generate deduction guides for alias templates from non-template explicit deduction guides (PR #96686)

2024-06-26 Thread Haojian Wu via cfe-commits
@@ -3216,6 +3226,44 @@ void DeclareImplicitDeductionGuidesForTypeAlias( Guides.suppressDiagnostics(); for (auto *G : Guides) { +if (auto *DG = dyn_cast(G)) { + // The deduction guide is a non-template function decl, we just clone it. + auto *FunctionType = +

[clang] [clang][Sema] Move the initializer lifetime checking code from SemaInit.cpp to a new place, NFC (PR #96758)

2024-06-26 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/96758 This is a refactoring change for better code isolation and reuse, the first step to extend it for assignments. >From 3c5318893322d1f904a52b2f92d5ccd191aa5930 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri,

[clang] [clang][Sema] Move the initializer lifetime checking code from SemaInit.cpp to a new place, NFC (PR #96758)

2024-06-26 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/96758 >From 6b18b58f4b3c4032c21252177709ab7759060c1f Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 21 Jun 2024 11:48:33 +0200 Subject: [PATCH] [clang][sema] Move the initializer lifetime checking code from SemaI

[clang] [clang] CTAD alias: fix transformation for require-clause expr Part2. (PR #93533)

2024-06-27 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/93533 >From 14817083f75f9615e9df4c905e09bc4e9b199336 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 17 May 2024 15:28:48 +0200 Subject: [PATCH 1/2] [clang] CTAD alias: fix transformation for require-clause expr P

[clang] [clang] CTAD alias: fix transformation for require-clause expr Part2. (PR #93533)

2024-06-27 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/93533 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] CTAD alias: fix transformation for require-clause expr Part2. (PR #93533)

2024-06-27 Thread Haojian Wu via cfe-commits
https://github.com/hokein commented: thanks for the review. https://github.com/llvm/llvm-project/pull/93533 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] CTAD alias: fix transformation for require-clause expr Part2. (PR #93533)

2024-06-27 Thread Haojian Wu via cfe-commits
@@ -2840,8 +2841,22 @@ buildAssociatedConstraints(Sema &SemaRef, FunctionTemplateDecl *F, for (unsigned Index = 0; Index < DeduceResults.size(); ++Index) { const auto &D = DeduceResults[Index]; -if (D.isNull()) +if (D.isNull()) { // non-deduced template paramete

[clang] [clang] CTAD alias: fix transformation for require-clause expr Part2. (PR #93533)

2024-06-27 Thread Haojian Wu via cfe-commits
@@ -2882,7 +2899,8 @@ buildAssociatedConstraints(Sema &SemaRef, FunctionTemplateDecl *F, // We add the outer template arguments which is [int] to the multi-level arg // list to ensure that the occurrence U in `C` will be replaced with int // during the substitution. - i

[clang] [clang] CTAD alias: fix transformation for require-clause expr Part2. (PR #93533)

2024-06-27 Thread Haojian Wu via cfe-commits
@@ -2840,8 +2841,22 @@ buildAssociatedConstraints(Sema &SemaRef, FunctionTemplateDecl *F, for (unsigned Index = 0; Index < DeduceResults.size(); ++Index) { const auto &D = DeduceResults[Index]; -if (D.isNull()) +if (D.isNull()) { // non-deduced template paramete

[clang] [clang] CTAD alias: fix transformation for require-clause expr Part2. (PR #93533)

2024-06-27 Thread Haojian Wu via cfe-commits
@@ -3100,6 +3118,7 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef, Context.getInjectedTemplateArg(NewParam)); TransformedDeducedAliasArgs[AliasTemplateParamIdx] = NewTemplateArgument; } + unsigned UndeducedTemplateParameterStartIndex = FPrimeTemplateParams.size

[clang] [Clang][AST] Let DeclPrinter print trailing requires expressions for template parameters (PR #96864)

2024-06-27 Thread Haojian Wu via cfe-commits
@@ -1189,6 +1189,16 @@ void DeclPrinter::printTemplateParameters(const TemplateParameterList *Params, Out << '>'; if (!OmitTemplateKW) Out << ' '; + + if (const Expr *RequiresClause = Params->getRequiresClause()) { hokein wrote: If I read the code co

[clang] [clang][Sema] Move the initializer lifetime checking code from SemaInit.cpp to a new place, NFC (PR #96758)

2024-06-27 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/96758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST] Let DeclPrinter print trailing requires expressions for template parameters (PR #96864)

2024-06-27 Thread Haojian Wu via cfe-commits
https://github.com/hokein approved this pull request. thanks, looks good. https://github.com/llvm/llvm-project/pull/96864 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

2024-06-27 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/96475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-27 Thread Haojian Wu via cfe-commits
@@ -12078,6 +12079,43 @@ static void DiagnoseFailedExplicitSpec(Sema &S, OverloadCandidate *Cand) { << (ES.getExpr() ? ES.getExpr()->getSourceRange() : SourceRange()); } +static void NoteImplicitDeductionGuide(Sema &S, CXXDeductionGuideDecl *DG) { + // We want to alway

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-27 Thread Haojian Wu via cfe-commits
https://github.com/hokein approved this pull request. thanks, looks good. https://github.com/llvm/llvm-project/pull/96084 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-27 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/96084 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-27 Thread Haojian Wu via cfe-commits
@@ -627,6 +627,9 @@ Improvements to Clang's diagnostics used rather than when they are needed for constant evaluation or when code is generated for them. The check is now stricter to prevent crashes for some unsupported declarations (Fixes #GH95495). +- Clang now shows i

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-27 Thread Haojian Wu via cfe-commits
@@ -12078,6 +12079,43 @@ static void DiagnoseFailedExplicitSpec(Sema &S, OverloadCandidate *Cand) { << (ES.getExpr() ? ES.getExpr()->getSourceRange() : SourceRange()); } +static void NoteImplicitDeductionGuide(Sema &S, CXXDeductionGuideDecl *DG) { + // We want to alway

[clang] [clang][docs] Update the gsl::Pointer/Owner attr doc (PR #96908)

2024-06-27 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/96908 - Fix some errors in the snippet; - update the code snippet to reflect the current implementation status in clang; >From 8da371ef1450852e3dede28b1f1dcb7c27ede530 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Th

[clang] [clang][docs] Update the gsl::Pointer/Owner attr doc (PR #96908)

2024-06-27 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/96908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

2024-06-28 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/96475 >From 97d1b80680112c3fa271501427a18273aed61dbe Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Mon, 24 Jun 2024 10:58:53 +0200 Subject: [PATCH 1/2] [clang] Extend the existing lifetimebound check for assignments.

[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

2024-06-28 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/96475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

2024-06-28 Thread Haojian Wu via cfe-commits
@@ -964,11 +966,26 @@ static bool pathOnlyInitializesGslPointer(IndirectLocalPath &Path) { return false; } -void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity, +void checkExprLifetime(Sema &SemaRef, const CheckingEntity &CEntity, E

[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

2024-06-28 Thread Haojian Wu via cfe-commits
https://github.com/hokein commented: thanks for the review. https://github.com/llvm/llvm-project/pull/96475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

2024-06-28 Thread Haojian Wu via cfe-commits
@@ -40,6 +40,12 @@ namespace usage_ok { int *p = A().class_member(); // expected-warning {{temporary whose address is used as value of local variable 'p' will be destroyed at the end of the full-expression}} int *q = A(); // expected-warning {{temporary whose address is us

[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

2024-06-28 Thread Haojian Wu via cfe-commits
@@ -964,11 +966,26 @@ static bool pathOnlyInitializesGslPointer(IndirectLocalPath &Path) { return false; } -void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity, +void checkExprLifetime(Sema &SemaRef, const CheckingEntity &CEntity, E

[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

2024-06-28 Thread Haojian Wu via cfe-commits
@@ -1053,16 +1072,23 @@ void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity, if (pathContainsInit(Path)) return false; -SemaRef.Diag(DiagLoc, diag::warn_dangling_variable) -<< RK << !Entity.getParent() -<< Ex

<    21   22   23   24   25   26   27   28   29   30   >