[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-11 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/84285 >From 48b3261e1d217b7ce78180314a222dca4d6aba18 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 7 Mar 2024 15:19:28 +0800 Subject: [PATCH 1/5] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-11 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/84285 >From 48b3261e1d217b7ce78180314a222dca4d6aba18 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 7 Mar 2024 15:19:28 +0800 Subject: [PATCH 1/4] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-11 Thread Chuanqi Xu via cfe-commits
@@ -744,6 +744,9 @@ getCompilationDataBase(int argc, char **argv, std::string ) { return nullptr; } + // Only 1 threads is required if P1689 per file mode. + NumThreads = 1; ChuanqiXu9 wrote: Oh, sorry. I don't know why I missed this somehow. This

[clang] [C++20] [Modules] Introduce a tool 'clang-named-modules-querier' and two plugins 'ClangGetUsedFilesFromModulesPlugin' and 'ClangGetDeclsInModulesPlugin' (PR #72956)

2024-03-11 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > ClangGetUsedFilesFromModulesPlugin > > This has a hole where if a currently-unused file is not listed, but it is > changed in such a way that it now matters (e.g., it changes include order, > adds/removes includes, etc.), we need to recompile consumers. > > > what

[clang] Reland "[clang][modules] Print library module manifest path." (PR #82160)

2024-03-11 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > @ChuanqiXu9 since you suggested this test approach It looks like that I failed to understand VE is under X86 also... > do you know whether this is the expected behavior of -sysroot ? I am not sure. This is surprising to me too. > The point is to build libraries and test

[clang] 0f501c3 - Revert "[C++20][Coroutines] Lambda-coroutine with operator new in promise_type (#84193)"

2024-03-11 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-03-11T17:02:43+08:00 New Revision: 0f501c30b9601627c236f9abca8a3befba5dc161 URL: https://github.com/llvm/llvm-project/commit/0f501c30b9601627c236f9abca8a3befba5dc161 DIFF: https://github.com/llvm/llvm-project/commit/0f501c30b9601627c236f9abca8a3befba5dc161.diff

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-11 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: This commit breaks our coroutines library async_simple `https://github.com/alibaba/async_simple` and here is a (relative) minimal reproducer: https://godbolt.org/z/sG5jzcGEz The reproducer comes from an implementation for async_simple::Generator

[clang] 3f6bc1a - [C++20] [Moduls] Avoid computing odr hash for functions from comparing constraint expression

2024-03-10 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-03-11T11:39:21+08:00 New Revision: 3f6bc1adf805681293c2ef0b93b708ff52244c00 URL: https://github.com/llvm/llvm-project/commit/3f6bc1adf805681293c2ef0b93b708ff52244c00 DIFF: https://github.com/llvm/llvm-project/commit/3f6bc1adf805681293c2ef0b93b708ff52244c00.diff

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-03-10 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/79712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-03-10 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I'll merge this since I find you may not have commit access. https://github.com/llvm/llvm-project/pull/79712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Coroutines] lambda-coroutine with promise_type ctor. (PR #84519)

2024-03-10 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/84519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-03-10 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM then. Thanks. https://github.com/llvm/llvm-project/pull/79712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/84285 >From dd9711be2368a299b408d0ff06ec9c1c0540083b Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 7 Mar 2024 15:19:28 +0800 Subject: [PATCH 1/3] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
@@ -893,102 +889,118 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { if (Format == ScanningOutputFormat::Full) FD.emplace(ModuleName.empty() ? Inputs.size() : 0); - if (Verbose) { -llvm::outs() << "Running clang-scan-deps on " <<

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
@@ -893,102 +889,118 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { if (Format == ScanningOutputFormat::Full) FD.emplace(ModuleName.empty() ? Inputs.size() : 0); - if (Verbose) { -llvm::outs() << "Running clang-scan-deps on " <<

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
@@ -744,6 +744,9 @@ getCompilationDataBase(int argc, char **argv, std::string ) { return nullptr; } + // Only 1 threads is required if P1689 per file mode. + NumThreads = 1; ChuanqiXu9 wrote: Makes sense. Done.

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/84285 >From dd9711be2368a299b408d0ff06ec9c1c0540083b Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 7 Mar 2024 15:19:28 +0800 Subject: [PATCH 1/2] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread

[clang] [C++20] [Modules] Introduce reduced BMI (PR #75894)

2024-03-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/75894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/84285 I suddenly found that the clang scan deps may use all concurrent threads to scan the files. It makes sense in the batch mode. But in P1689 per file mode, it simply wastes times and resources. This patch

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Chuanqi Xu via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM with the adding the comments. https://github.com/llvm/llvm-project/pull/84193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Chuanqi Xu via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Chuanqi Xu via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

[clang] [C++20] [Modules] Introduce reduced BMI (PR #75894)

2024-03-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Can we add a release note and documentation for this? Thanks! The current patch is transparent to users and it is only part of the series patches. I'd like to document that after I made the series of patches. https://github.com/llvm/llvm-project/pull/75894

[clang] d3df2a8 - [C++20] [Modules] Handle transitive import in the module properly

2024-03-05 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-03-06T15:46:55+08:00 New Revision: d3df2a834cf6febb44c699d109b9e7f622194837 URL: https://github.com/llvm/llvm-project/commit/d3df2a834cf6febb44c699d109b9e7f622194837 DIFF: https://github.com/llvm/llvm-project/commit/d3df2a834cf6febb44c699d109b9e7f622194837.diff

[clang] [C++20] [Modules] Introduce reduced BMI (PR #75894)

2024-03-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I am going to land this in the week later if no objections come in. I think it is necessary to land the series of patches (to reduce the contents of BMI) for clang19. And of course, the functionality will be opt in for one~two releases for experimental.

[clang] [C++20] [Modules] Introduce reduced BMI (PR #75894)

2024-03-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Do you expect to make any changes to type streaming? I don't expect to do that explicitly. The number of types deserialized can be decreased naturally after we avoid emitting declarations during the writing. https://github.com/llvm/llvm-project/pull/75894

[clang] [C++20] [Modules] Introduce reduced BMI (PR #75894)

2024-03-05 Thread Chuanqi Xu via cfe-commits
@@ -830,6 +843,19 @@ class PCHGenerator : public SemaConsumer { bool hasEmittedPCH() const { return Buffer->IsComplete; } }; +class ReducedBMIGenerator : public PCHGenerator { +public: + ReducedBMIGenerator(const Preprocessor , InMemoryModuleCache , +

[clang] [C++20] [Modules] Introduce reduced BMI (PR #75894)

2024-03-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > * I do not want to block progress, so let's move forward with this patch for > now. Yeah. Great to see we have some progress finally. I think this is really important since I see more and more peope complaninig the performance for modules. I feel this series patch is key

[clang] [clang][NFC] Format clang/lib/Sema/Sema.cpp (PR #83974)

2024-03-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Thank you for references both. > > Actually, I'd like to have PR like #83961. Is it acceptable to merge this > kind of PR in that case then? I don't feel the patches are related. I think you can only format the changed lines.

[clang] [clang][NFC] Format clang/lib/Sema/Sema.cpp (PR #83974)

2024-03-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Oh, I found it here: https://llvm.org/docs/CodingStandards.html#introduction > Our long term goal is for the entire codebase to follow the convention, but > we explicitly do not want patches that do large-scale reformatting of > existing code.

[clang] [clang][NFC] Format clang/lib/Sema/Sema.cpp (PR #83974)

2024-03-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I remember we have policies that we don't like patches which purely formats codes. It makes backporting and cherry-picking harder. But I can't find the wording now. CC: @AaronBallman @Endilll https://github.com/llvm/llvm-project/pull/83974

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-03-04 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Thanks. This looks good to me except few nit comments. Have you tested on a real world workloads? https://github.com/llvm/llvm-project/pull/79712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-03-04 Thread Chuanqi Xu via cfe-commits
@@ -167,6 +167,53 @@ class CoroCloner { } // end anonymous namespace +// FIXME: +// Lower the intrinisc in CoroEarly phase if coroutine frame doesn't escape +// and it is known that other transformations, for example, sanitizers +// won't lead to incorrect code. +static void

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-03-04 Thread Chuanqi Xu via cfe-commits
@@ -338,6 +414,71 @@ static QualType getCoroutineSuspendExprReturnType(const ASTContext , } #endif +llvm::Function * +CodeGenFunction::generateAwaitSuspendWrapper(Twine const , + Twine const , +

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-03-04 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/79712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-03 Thread Chuanqi Xu via cfe-commits
@@ -72,6 +72,10 @@ sections with improvements to Clang's support for those languages. C++ Language Changes +C++14 Feature Support +^ +- Sized deallocation is enabled by default in C++14 onwards. ChuanqiXu9 wrote: It

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-03 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,44 @@ +//===--- SizedDellocation.h - Sized Deallocation *- 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:

[clang] Reland "[clang][modules] Print library module manifest path." (PR #82160)

2024-02-27 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @mordante if we want this for 18, we need to land and backport it in this week. https://github.com/llvm/llvm-project/pull/82160 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-27 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > That'd mean that we "just" need to replace LazySpecializationInfo > *LazySpecializations = nullptr; with the on-disk hash table approach. That > would probably require centralizing that logic somewhere in the ASTReader > (the way this PR does) but with minimal changes wrt

[clang] D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one. (PR #83108)

2024-02-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/83108 >From 59e1880df74434e3c446705788d92b5949d99536 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 7 Jan 2018 15:16:11 +0200 Subject: [PATCH 1/3] D41416: [modules] [pch] Do not deserialize all lazy

[clang] D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one. (PR #83108)

2024-02-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Weird. I only see two failures in my local environment: ``` Failed Tests (2): Clang :: Modules/cxx-templates.cpp Clang :: Modules/odr_hash.cpp ``` And I saw both of them in my patch. It is simply order mismatches. https://github.com/llvm/llvm-project/pull/83108

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Oh, I didn't notice you've removed D153003 already. But the branch name looks not good. So I've created a pr in https://github.com/llvm/llvm-project/pull/83108 https://github.com/llvm/llvm-project/pull/76774 ___ cfe-commits mailing

[clang] D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one. (PR #83108)

2024-02-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Personally I feel this patch is good and the testing result from our workload shows it is good too. But it looks like the performance testing results from google @zygoloid @ilya-biryukov is not good. So maybe we need to wait for landing this. (It will be great if

[clang] D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one. (PR #83108)

2024-02-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/83108 This from https://reviews.llvm.org/D41416. And we plan to introduce on disk hash table based on this. See https://github.com/llvm/llvm-project/pull/76774. Following off are cited from

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-02-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @rjmccall @dwblaikie https://github.com/llvm/llvm-project/pull/75912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-26 Thread Chuanqi Xu via cfe-commits
@@ -41,7 +41,7 @@ void TestCatch2() { try { } // CHECK-NEXT:CXXCatchStmt -// CHECK-NEXT: NULL +// CHECK-NEXT: VarDecl {{.*}} '' ChuanqiXu9 wrote: Maybe we can improve to print this. https://github.com/llvm/llvm-project/pull/80976

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-26 Thread Chuanqi Xu via cfe-commits
@@ -1053,6 +1053,10 @@ class VarDecl : public DeclaratorDecl, public Redeclarable { LLVM_PREFERRED_TYPE(bool) unsigned ExceptionVar : 1; +/// To Check the ellipsis +LLVM_PREFERRED_TYPE(bool) +unsigned EllipsisVar : 1; ChuanqiXu9 wrote:

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-26 Thread Chuanqi Xu via cfe-commits
@@ -16983,7 +16983,7 @@ VarDecl *Sema::BuildExceptionDeclaration(Scope *S, /// ActOnExceptionDeclarator - Parsed the exception-declarator in a C++ catch /// handler. -Decl *Sema::ActOnExceptionDeclarator(Scope *S, Declarator ) { +Decl *Sema::ActOnExceptionDeclarator(Scope *S,

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-26 Thread Chuanqi Xu via cfe-commits
@@ -1053,6 +1053,10 @@ class VarDecl : public DeclaratorDecl, public Redeclarable { LLVM_PREFERRED_TYPE(bool) unsigned ExceptionVar : 1; +/// To Check the ellipsis ChuanqiXu9 wrote: The comment is not clear

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-26 Thread Chuanqi Xu via cfe-commits
@@ -2698,9 +2698,16 @@ StmtResult Parser::ParseCXXCatchBlock(bool FnCatch) { Declarator ExDecl(DS, Attributes, DeclaratorContext::CXXCatch); ParseDeclarator(ExDecl); ExceptionDecl = Actions.ActOnExceptionDeclarator(getCurScope(), ExDecl); - } else -

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-26 Thread Chuanqi Xu via cfe-commits
@@ -271,6 +271,9 @@ void TextNodeDumper::Visit(const Decl *D) { OS << " hidden"; if (D->isImplicit()) OS << " implicit"; + if (const VarDecl *ND = dyn_cast(D)) + if (ND->isEllipsisVariable()) + OS << " catch_all"; ChuanqiXu9 wrote: ditto

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-26 Thread Chuanqi Xu via cfe-commits
@@ -115,6 +115,10 @@ void JSONNodeDumper::Visit(const Decl *D) { else if (D->isThisDeclarationReferenced()) JOS.attribute("isReferenced", true); + if (const VarDecl *ND = dyn_cast(D)) + if (ND->isEllipsisVariable()) + JOS.attribute("catch_all", true);

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-26 Thread Chuanqi Xu via cfe-commits
@@ -1474,6 +1478,16 @@ class VarDecl : public DeclaratorDecl, public Redeclarable { NonParmVarDeclBits.ExceptionVar = EV; } + /// Determine the Ellipsis (...) or not + bool isEllipsisVariable() const { +return isa(this) ? false : NonParmVarDeclBits.EllipsisVar; +

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: +1 that we should reduce the impact of the patch as much as possible. Also every time we change the data member of decls and stmts, we need to update the serialization part. https://github.com/llvm/llvm-project/pull/80976

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/80976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang serialization unittests: fix some leaks (PR #82773)

2024-02-25 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/82773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] b014944 - [NFC] [doc] Mentioning to include the guard headers from imported modules

2024-02-23 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-02-23T16:54:13+08:00 New Revision: b014944e47ba6e2031e968268b15fba43a9e1dbf URL: https://github.com/llvm/llvm-project/commit/b014944e47ba6e2031e968268b15fba43a9e1dbf DIFF: https://github.com/llvm/llvm-project/commit/b014944e47ba6e2031e968268b15fba43a9e1dbf.diff

[clang] 2e5af56 - [C++20] [Modules] Allow to compile a pcm with and without -fPIC

2024-02-22 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-02-23T11:05:15+08:00 New Revision: 2e5af56b05c2d39ab2c829bf4c13190523b67ddd URL: https://github.com/llvm/llvm-project/commit/2e5af56b05c2d39ab2c829bf4c13190523b67ddd DIFF: https://github.com/llvm/llvm-project/commit/2e5af56b05c2d39ab2c829bf4c13190523b67ddd.diff

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-21 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > > Let's zoom out a little. The approach in D41416 shows that it is > > > > feasible to store _a_ hash of the template arguments to delay eager > > > > deserializations. The ODR hash approach is a second order problem > > > > because we can swap it with something better

[clang] 96e5657 - [NFC] [Modules] Add a test for issue 81745

2024-02-19 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-02-20T14:33:48+08:00 New Revision: 96e56573089b2a211c71660b0ffc7deb21049bdd URL: https://github.com/llvm/llvm-project/commit/96e56573089b2a211c71660b0ffc7deb21049bdd DIFF: https://github.com/llvm/llvm-project/commit/96e56573089b2a211c71660b0ffc7deb21049bdd.diff

[clang] [clangd] Fix C++20 modules crash (PR #81919)

2024-02-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I'd like to close this since the issue got closed. https://github.com/llvm/llvm-project/pull/81919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clangd] Fix C++20 modules crash (PR #81919)

2024-02-19 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/81919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Record whether the ODR is skipped (PR #82302)

2024-02-19 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/82302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Record whether the ODR is skipped (PR #82302)

2024-02-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: The CI failure looks unrelated to this: ``` CMake Error at C:/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/CMakeDetermineCompilerId.cmake:777 (file): --   | file STRINGS file   |

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-19 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/80687 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-19 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/80687 >From 19065e2e25e8bbd735b157239702e4394659bbc7 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 5 Feb 2024 22:31:19 +0800 Subject: [PATCH 1/2] [docs] [C++20] [Modules] Ideas for transiting to modules ---

[clang] [Serialization] Record whether the ODR is skipped (PR #82302)

2024-02-19 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/82302 Close https://github.com/llvm/llvm-project/issues/80570. In https://github.com/llvm/llvm-project/commit/a0b6747804e46665ecfd00295b60432bfe1775b6, we skipped ODR checks for decls in GMF. Then it should be

[clang] [Clang] CXXConstructExpr may be immediate calls. (PR #82179)

2024-02-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/82179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-18 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Let's zoom out a little. The approach in D41416 shows that it is feasible to > store _a_ hash of the template arguments to delay eager deserializations. The > ODR hash approach is a second order problem because we can swap it with > something better once we need to. In

[clang] Reland "[clang][modules] Print library module manifest path." (PR #82160)

2024-02-18 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,38 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// REQUIRES: x86-registered-target ChuanqiXu9 wrote: ```suggestion // FIXME: // REQUIRES: x86-registered-target ``` I feel better with a FIXME to remind us to

[clang] Reland "[clang][modules] Print library module manifest path." (PR #82160)

2024-02-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/82160 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland "[clang][modules] Print library module manifest path." (PR #82160)

2024-02-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/82160 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-18 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > But my point is that we can't land that if we don't understand what's going > > wrong without that patch. > > We understand that very well and it's described in > https://reviews.llvm.org/D153003 as well as the surrounding discussions: > because of the way that

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-18 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > > > > > > > > [do not merge] [runtime-cxxmodules] Rework our lazy > > > > > > > > > > template specialization deserialization mechanism > > > > > > > > > > [root-project/root#14495](https://github.com/root-project/root/pull/14495) > > > > > > > > > > > > > > > > > > >

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-18 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > > > > > > [do not merge] [runtime-cxxmodules] Rework our lazy template > > > > > > > > specialization deserialization mechanism > > > > > > > > [root-project/root#14495](https://github.com/root-project/root/pull/14495) > > > > > > > > > > > > > > > > > > > > > From >

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-18 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > > > > > > > [do not merge] [runtime-cxxmodules] Rework our lazy template > > > > > > > > > specialization deserialization mechanism > > > > > > > > > [root-project/root#14495](https://github.com/root-project/root/pull/14495) > > > > > > > > > > > > > > > > > > > > > >

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-18 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > > > > > [do not merge] [runtime-cxxmodules] Rework our lazy template > > > > > > > specialization deserialization mechanism > > > > > > > [root-project/root#14495](https://github.com/root-project/root/pull/14495) > > > > > > > > > > > > > > > > > > From > > > > > >

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-02-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Sounds good. My instinct reaction to the title is that you're going to unify the annoying duplicated interfaces for the 5 specialization classes (function specialization, class/var (partial) specializations). But it is still good to merge these

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-02-18 Thread Chuanqi Xu via cfe-commits
@@ -1792,23 +1807,11 @@ class ClassTemplateSpecializationDecl llvm::PointerUnion SpecializedTemplate; - /// Further info for explicit template specialization/instantiation. - struct ExplicitSpecializationInfo { -/// The type-as-written. -TypeSourceInfo

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-02-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > > > [do not merge] [runtime-cxxmodules] Rework our lazy template > > > > > specialization deserialization mechanism > > > > > [root-project/root#14495](https://github.com/root-project/root/pull/14495) > > > > > > > > > > > > From > > > >

[clang] 1ecbab5 - [C++20] [Modules] Don't import non-inline function bodies even if it is marked as always_inline

2024-02-17 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-02-18T15:15:28+08:00 New Revision: 1ecbab56dcbb78268c8d19af34a50591f90b12a0 URL: https://github.com/llvm/llvm-project/commit/1ecbab56dcbb78268c8d19af34a50591f90b12a0 DIFF: https://github.com/llvm/llvm-project/commit/1ecbab56dcbb78268c8d19af34a50591f90b12a0.diff

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > [do not merge] [runtime-cxxmodules] Rework our lazy template > > > specialization deserialization mechanism > > > [root-project/root#14495](https://github.com/root-project/root/pull/14495) > > > > > > From > >

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-02-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > [do not merge] [runtime-cxxmodules] Rework our lazy template specialization > deserialization mechanism root-project/root#14495 >From https://github.com/root-project/root/pull/14495, I see there is new reply >saying the testing is actually fine. Do you think we still need

[clang] [C++20] [Modules] Introduce reduced BMI (PR #75894)

2024-02-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @iains @mizvekov ping~ https://github.com/llvm/llvm-project/pull/75894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-02-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: (This is another example that the github review can't work well with the reverted patches...) @mordante I think you can add `// REQUIRES: x86-registered-target` to the test if @kaz7 can't respond quickly. It will skip the test on targets other than x86. And it should keep

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
@@ -5097,6 +5099,22 @@ class CoroutineSuspendExpr : public Expr { return static_cast(SubExprs[SubExpr::Operand]); } + SuspendReturnType getSuspendReturnType() const { +auto *SuspendExpr = getSuspendExpr(); +assert(SuspendExpr); + +auto SuspendType =

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
@@ -232,16 +250,74 @@ static LValueOrRValue emitSuspendExpression(CodeGenFunction , CGCoroData auto *NullPtr = llvm::ConstantPointerNull::get(CGF.CGM.Int8PtrTy); auto *SaveCall = Builder.CreateCall(CoroSave, {NullPtr}); + const auto AwaitSuspendCanThrow = +

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
@@ -1396,9 +1478,18 @@ static bool simplifySuspendPoint(CoroSuspendInst *Suspend, if (!SubFn) return false; - // Does not refer to the current coroutine, we cannot do anything with it. - if (SubFn->getFrame() != CoroBegin) -return false; + auto Frame =

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
@@ -5038,6 +5038,8 @@ class CoroutineSuspendExpr : public Expr { OpaqueValueExpr *OpaqueValue = nullptr; public: + enum SuspendReturnType { SuspendVoid, SuspendBool, SuspendHandle }; ChuanqiXu9 wrote: nit: Add a comment to explain that the return type of

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Thanks. This looks much better now. Given the CoroAwaitSuspendInst is lowered before splitting coroutines, I think we don't need to handle it specially in `CoroSplit` any more. https://github.com/llvm/llvm-project/pull/79712

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
@@ -2013,6 +2104,10 @@ splitCoroutine(Function , SmallVectorImpl , buildCoroutineFrame(F, Shape, MaterializableCallback); replaceFrameSizeAndAlignment(Shape); + IRBuilder<> Builder(M.getContext()); ChuanqiXu9 wrote: ```suggestion IRBuilder<>

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
@@ -380,66 +380,7 @@ static Expr *maybeTailCall(Sema , QualType RetType, Expr *E, // __builtin_coro_resume so that the cleanup code are not inserted in-between // the resume call and return instruction, which would interfere with the // musttail call contract. -

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
@@ -167,6 +167,47 @@ class CoroCloner { } // end anonymous namespace +// FIXME: +// Lower the intrinisc earlier if coroutine frame doesn't escape ChuanqiXu9 wrote: ```suggestion // Lower the intrinisc in CoroEarly phase if coroutine frame doesn't escape ```

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
@@ -232,16 +250,74 @@ static LValueOrRValue emitSuspendExpression(CodeGenFunction , CGCoroData auto *NullPtr = llvm::ConstantPointerNull::get(CGF.CGM.Int8PtrTy); auto *SaveCall = Builder.CreateCall(CoroSave, {NullPtr}); + const auto AwaitSuspendCanThrow = +

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
@@ -338,6 +414,71 @@ static QualType getCoroutineSuspendExprReturnType(const ASTContext , } #endif +llvm::Function * +CodeGenFunction::generateAwaitSuspendWrapper(Twine const , + Twine const , +

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
@@ -232,16 +250,74 @@ static LValueOrRValue emitSuspendExpression(CodeGenFunction , CGCoroData auto *NullPtr = llvm::ConstantPointerNull::get(CGF.CGM.Int8PtrTy); auto *SaveCall = Builder.CreateCall(CoroSave, {NullPtr}); + const auto AwaitSuspendCanThrow = +

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
@@ -173,19 +173,36 @@ static bool ResumeStmtCanThrow(const Stmt *S) { return false; } +static bool AwaitSuspendStmtCanThrow(const Stmt *S) { + return ResumeStmtCanThrow(S); +} + // Emit suspend expression which roughly looks like: // // auto && x = CommonExpr(); //

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-02-17 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/79712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5   6   7   8   9   10   >