[clang] [Modules] [HeaderSearch] Don't reenter headers if it is pragma once (PR #76119)

2024-01-15 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @vsapsai gentle ping~ https://github.com/llvm/llvm-project/pull/76119 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7bc170a - [C++20] [Modules] [Serialization] Don't record '#pragma once' information in named modules

2024-01-15 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-01-15T17:00:49+08:00 New Revision: 7bc170a261ae0daaddcc1abeacf7e9e0f1f66d02 URL: https://github.com/llvm/llvm-project/commit/7bc170a261ae0daaddcc1abeacf7e9e0f1f66d02 DIFF: https://github.com/llvm/llvm-project/commit/7bc170a261ae0daaddcc1abeacf7e9e0f1f66d02.diff

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

2024-01-14 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/76451 ___ 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-01-14 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-14 Thread Chuanqi Xu via cfe-commits
@@ -33,6 +34,7 @@ #include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/Casting.h" ChuanqiXu9 wrote: Maybe we don't need this? https://github.com/llvm/llvm-project/pull/77066

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-14 Thread Chuanqi Xu via cfe-commits
@@ -15845,8 +15845,10 @@ void Sema::CheckCoroutineWrapper(FunctionDecl *FD) { RecordDecl *RD = FD->getReturnType()->getAsRecordDecl(); if (!RD || !RD->getUnderlyingDecl()->hasAttr()) return; - // Allow `get_return_object()`. - if (FD->getDeclName().isIdentifier() &&

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-14 Thread Chuanqi Xu via cfe-commits
@@ -1796,6 +1797,32 @@ bool CoroutineStmtBuilder::makeOnException() { return true; } +// Adds [[clang::coro_wrapper]] and [[clang::coro_disable_lifetimebound]] +// attributes to the function `get_return_object`. ChuanqiXu9 wrote: ```suggestion //

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-14 Thread Chuanqi Xu via cfe-commits
@@ -1796,6 +1797,32 @@ bool CoroutineStmtBuilder::makeOnException() { return true; } +// Adds [[clang::coro_wrapper]] and [[clang::coro_disable_lifetimebound]] +// attributes to the function `get_return_object`. +static void handleGetReturnObject(Sema , Expr *E) { + if

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

2024-01-14 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. While we need to delete `clang/test/Driver/Inputs/cxx23_modules/usr/lib/x86_64-linux-gnu/libc++.so` and `clang/test/Driver/Inputs/cxx23_modules/usr/lib/x86_64-linux-gnu/modules.json`.

[clang] Fix crash with modules and constexpr destructor (PR #69076)

2024-01-14 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. Thanks for your patience. https://github.com/llvm/llvm-project/pull/69076 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] 4b99af3 - [docs] Update doc for C++20 Modules after dc4e85b

2024-01-11 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-01-12T14:16:19+08:00 New Revision: 4b99af34199208e82f6a8806bfae1d3dea007936 URL: https://github.com/llvm/llvm-project/commit/4b99af34199208e82f6a8806bfae1d3dea007936 DIFF: https://github.com/llvm/llvm-project/commit/4b99af34199208e82f6a8806bfae1d3dea007936.diff

[clang] dc4e85b - [C++20] [Modules] Remove hardcoded path to imported module in BMIs

2024-01-11 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-01-12T13:47:59+08:00 New Revision: dc4e85bd79ff17014cbbe4a9db1d9b91929e91ce URL: https://github.com/llvm/llvm-project/commit/dc4e85bd79ff17014cbbe4a9db1d9b91929e91ce DIFF: https://github.com/llvm/llvm-project/commit/dc4e85bd79ff17014cbbe4a9db1d9b91929e91ce.diff

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-11 Thread Chuanqi Xu via cfe-commits
@@ -297,6 +297,26 @@ struct ReadySuspendResumeResult { bool IsInvalid; }; +// Adds [[clang::coro_wrapper]] and [[clang::coro_disable_lifetimebound]] +// attributes to `get_return_object`. +static void handleGetReturnObject(Sema , MemberExpr *ME) { + if (!ME ||

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

2024-01-11 Thread Chuanqi Xu via cfe-commits
@@ -6135,6 +6141,42 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetStdModuleManifestPath(const Compilation , + const ToolChain ) const { + +

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

2024-01-11 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: %clang -print-library-module-manifest-path \ +// RUN: -stdlib=libc++ \ +// RUN: --sysroot=%S/Inputs/cxx23_modules \ +// RUN: --target=x86_64-linux-gnu 2>&1 \ +// RUN:

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

2024-01-11 Thread Chuanqi Xu via cfe-commits
@@ -6135,6 +6141,42 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetStdModuleManifestPath(const Compilation , + const ToolChain ) const { + +

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

2024-01-11 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: LGTM generally. https://github.com/llvm/llvm-project/pull/76451 ___ 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-01-11 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,9 @@ +// Test that -print-library-module-manifest-path finds the correct file. +// +// Note this file is currently not available on Apple platforms ChuanqiXu9 wrote: I don't get the intention for the test since there is standard library related

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

2024-01-11 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/76451 ___ 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-01-11 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/76774 >From 50fd47f2bfda527807f8cc5e46425050246868aa Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 3 Jan 2024 11:33:17 +0800 Subject: [PATCH 1/3] Load Specializations Lazily ---

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

2024-01-11 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Update: Previously we will always try to load the specializations with the corresponding arguments before finding the specializations. This requires to hash the template arguments. This patch tries to improve this by trying to load the specializations only if

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

2024-01-11 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/76774 >From 50fd47f2bfda527807f8cc5e46425050246868aa Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 3 Jan 2024 11:33:17 +0800 Subject: [PATCH 1/3] Load Specializations Lazily ---

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-10 Thread Chuanqi Xu via cfe-commits
@@ -7575,15 +7577,27 @@ static void visitLifetimeBoundArguments(IndirectLocalPath , Expr *Call, Path.pop_back(); }; - if (ObjectArg && implicitObjectParamIsLifetimeBound(Callee)) -VisitLifetimeBoundArg(Callee, ObjectArg); - bool CheckCoroCall = false; if

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

2024-01-10 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > @ChuanqiXu9, this PR does not seem to compile. Can you make the second commit > work before I start testing? Oh, sorry. It should work now! https://github.com/llvm/llvm-project/pull/76774 ___ cfe-commits mailing list

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

2024-01-10 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/76774 >From 50fd47f2bfda527807f8cc5e46425050246868aa Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 3 Jan 2024 11:33:17 +0800 Subject: [PATCH 1/2] Load Specializations Lazily ---

[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)

2024-01-09 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Can you provide more context for this? https://github.com/llvm/llvm-project/pull/77465 ___ 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-01-09 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Have you run that patch on bigger workflows? Do we have some performance > numbers to compare? I've tested it functionality in our largest workload about modules. It runs well. But our uses of modules don't have a lot of complexities while it has a large scale. For

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

2024-01-09 Thread Chuanqi Xu via cfe-commits
@@ -100,6 +100,11 @@ ExternalASTSource::FindExternalVisibleDeclsByName(const DeclContext *DC, return false; } +void ExternalASTSource::LoadExternalSpecializations( +const Decl *D, ArrayRef TemplateArgs) { + return; ChuanqiXu9 wrote: Will do in the

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

2024-01-09 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/76774 ___ 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-01-09 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/76774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-01-08 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I failed to use spr to create stacked review... So I just create the stacked > PR manually: #77417. Luckily the context are remained. I heard the current > context may be lost if we change to use spr now. https://github.com/llvm/llvm-project/pull/76774

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

2024-01-08 Thread Chuanqi Xu via cfe-commits
@@ -527,6 +527,10 @@ class ASTWriter : public ASTDeserializationListener, bool isLookupResultExternal(StoredDeclsList , DeclContext *DC); bool isLookupResultEntirelyExternal(StoredDeclsList , DeclContext *DC); + uint64_t + WriteSpecsLookupTable(NamedDecl *D,

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

2024-01-08 Thread Chuanqi Xu via cfe-commits
@@ -1249,3 +1249,5 @@ void ODRHash::AddQualType(QualType T) { void ODRHash::AddBoolean(bool Value) { Bools.push_back(Value); } + +void ODRHash::AddInteger(unsigned Value) { ID.AddInteger(Value); } ChuanqiXu9 wrote: Done

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

2024-01-08 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I failed to use spr to create stacked review... So I just create the stacked PR manually: https://github.com/llvm/llvm-project/pull/77417 https://github.com/llvm/llvm-project/pull/76774 ___ cfe-commits mailing list

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

2024-01-08 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/76774 >From 50fd47f2bfda527807f8cc5e46425050246868aa Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 3 Jan 2024 11:33:17 +0800 Subject: [PATCH] Load Specializations Lazily ---

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-08 Thread Chuanqi Xu via cfe-commits
@@ -7575,15 +7577,27 @@ static void visitLifetimeBoundArguments(IndirectLocalPath , Expr *Call, Path.pop_back(); }; - if (ObjectArg && implicitObjectParamIsLifetimeBound(Callee)) -VisitLifetimeBoundArg(Callee, ObjectArg); - bool CheckCoroCall = false; if

[clang] [coroutines] Detect lifetime issues with coroutine lambda captures (PR #77066)

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

[clang] [coroutines] Detect lifetime issues with coroutine lambda captures (PR #77066)

2024-01-08 Thread Chuanqi Xu via cfe-commits
@@ -7575,15 +7577,27 @@ static void visitLifetimeBoundArguments(IndirectLocalPath , Expr *Call, Path.pop_back(); }; - if (ObjectArg && implicitObjectParamIsLifetimeBound(Callee)) -VisitLifetimeBoundArg(Callee, ObjectArg); - bool CheckCoroCall = false; if

[clang] [coroutines] Detect lifetime issues with coroutine lambda captures (PR #77066)

2024-01-08 Thread Chuanqi Xu via cfe-commits
@@ -7575,15 +7577,27 @@ static void visitLifetimeBoundArguments(IndirectLocalPath , Expr *Call, Path.pop_back(); }; - if (ObjectArg && implicitObjectParamIsLifetimeBound(Callee)) -VisitLifetimeBoundArg(Callee, ObjectArg); - bool CheckCoroCall = false; if

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

2024-01-08 Thread Chuanqi Xu via cfe-commits
@@ -1249,3 +1249,5 @@ void ODRHash::AddQualType(QualType T) { void ODRHash::AddBoolean(bool Value) { Bools.push_back(Value); } + +void ODRHash::AddInteger(unsigned Value) { ID.AddInteger(Value); } ChuanqiXu9 wrote: Yeah, I just saw it. My concern for

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

2024-01-08 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > This is a great way to start a new year ;) > > > The phab link is https://reviews.llvm.org/D41416. > > > In general I was wondering could we simplify the implementation by > > > loading the specialization hash table upon module load. That should be > > > relatively

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

2024-01-08 Thread Chuanqi Xu via cfe-commits
@@ -1249,3 +1249,5 @@ void ODRHash::AddQualType(QualType T) { void ODRHash::AddBoolean(bool Value) { Bools.push_back(Value); } + +void ODRHash::AddInteger(unsigned Value) { ID.AddInteger(Value); } ChuanqiXu9 wrote: It looks like the qualified related

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

2024-01-07 Thread Chuanqi Xu via cfe-commits
@@ -1249,3 +1249,5 @@ void ODRHash::AddQualType(QualType T) { void ODRHash::AddBoolean(bool Value) { Bools.push_back(Value); } + +void ODRHash::AddInteger(unsigned Value) { ID.AddInteger(Value); } ChuanqiXu9 wrote: I had this

[clang] Fix crash with modules and constexpr destructor (PR #69076)

2024-01-07 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Well, this patch is up since almost three months now (!). Sure, we can keep > carrying a similar fix downstream, but ideally I would really like to get rid > of as many local changes as possible. That's not possible without proper > review, but the current situation is

[clang] Fix crash with modules and constexpr destructor (PR #69076)

2024-01-07 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Ping, is this ok to be accepted and landed? If it is not hurry, I prefer to wait @cor3ntin to have a look. But given the scale of the patch, it should be good too to land it in 2 weeks if there is no other comments. https://github.com/llvm/llvm-project/pull/69076

[clang] Fix crash with modules and constexpr destructor (PR #69076)

2024-01-07 Thread Chuanqi Xu via cfe-commits
@@ -15754,10 +15754,18 @@ bool Expr::EvaluateAsInitializer(APValue , const ASTContext , LValue LVal; LVal.set(VD); -if (!EvaluateInPlace(Value, Info, LVal, this, - /*AllowNonLiteralTypes=*/true) || -EStatus.HasSideEffects) -

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

2024-01-07 Thread Chuanqi Xu via cfe-commits
@@ -1249,3 +1249,5 @@ void ODRHash::AddQualType(QualType T) { void ODRHash::AddBoolean(bool Value) { Bools.push_back(Value); } + +void ODRHash::AddInteger(unsigned Value) { ID.AddInteger(Value); } ChuanqiXu9 wrote: The secret why ODRHash can handle this may

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

2024-01-07 Thread Chuanqi Xu via cfe-commits
@@ -1249,3 +1249,5 @@ void ODRHash::AddQualType(QualType T) { void ODRHash::AddBoolean(bool Value) { Bools.push_back(Value); } + +void ODRHash::AddInteger(unsigned Value) { ID.AddInteger(Value); } ChuanqiXu9 wrote: I tried to add a test case to show the

[clang] 9b808a4 - [NFC] [Modules] Add a test case for selecting specializations with aliased template args

2024-01-07 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-01-08T14:46:11+08:00 New Revision: 9b808a4beb8e6c8255b412fdd6f5a3e20cbcf270 URL: https://github.com/llvm/llvm-project/commit/9b808a4beb8e6c8255b412fdd6f5a3e20cbcf270 DIFF: https://github.com/llvm/llvm-project/commit/9b808a4beb8e6c8255b412fdd6f5a3e20cbcf270.diff

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

2024-01-07 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,50 @@ +// REQUIRES: !system-windows + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: cd %t +// +// RUN: %clang_cc1 -std=c++20 %t/layer1.cppm -triple %itanium_abi_triple \ +// RUN: -emit-module-interface -o %t/foo-layer1.pcm +// RUN: %clang_cc1 -std=c++20

[clang] [coroutines] Detect lifetime issues with coroutine lambda captures (PR #77066)

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

[clang] [coroutines] Detect lifetime issues with coroutine lambda captures (PR #77066)

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

[clang] [coroutines] Detect lifetime issues with coroutine lambda captures (PR #77066)

2024-01-07 Thread Chuanqi Xu via cfe-commits
@@ -7575,15 +7577,27 @@ static void visitLifetimeBoundArguments(IndirectLocalPath , Expr *Call, Path.pop_back(); }; - if (ObjectArg && implicitObjectParamIsLifetimeBound(Callee)) -VisitLifetimeBoundArg(Callee, ObjectArg); - bool CheckCoroCall = false; if

[clang] [coroutines] Detect lifetime issues with coroutine lambda captures (PR #77066)

2024-01-07 Thread Chuanqi Xu via cfe-commits
@@ -7575,15 +7577,27 @@ static void visitLifetimeBoundArguments(IndirectLocalPath , Expr *Call, Path.pop_back(); }; - if (ObjectArg && implicitObjectParamIsLifetimeBound(Callee)) -VisitLifetimeBoundArg(Callee, ObjectArg); - bool CheckCoroCall = false; if

[clang] [coroutines] Detect lifetime issues with coroutine lambda captures (PR #77066)

2024-01-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Maybe it'll be better to say this is related to `[[coro_lifetimebound]]`. My instinct reaction to this is that "no, this is not strictly correct". But I feel good after I know it is an extension of `[[coro_lifetimebound]]` only.

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

2024-01-05 Thread Chuanqi Xu via cfe-commits
@@ -1249,3 +1249,5 @@ void ODRHash::AddQualType(QualType T) { void ODRHash::AddBoolean(bool Value) { Bools.push_back(Value); } + +void ODRHash::AddInteger(unsigned Value) { ID.AddInteger(Value); } ChuanqiXu9 wrote: Great analysis. Fair enough, let's find a

[clang] [coroutines] Introduce [[clang::coro_disable_lifetimebound]] (PR #76818)

2024-01-05 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. I feel good with this. We can do other improvements in other patches. https://github.com/llvm/llvm-project/pull/76818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-01-04 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I'm Sam's colleague and wanted to mention that Sam won't be available until > January 15. It probably does not make much sense for someone else to take > over at this point as the change is large and waiting for Sam is more > efficient than ramping up someone else at this

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

2024-01-04 Thread Chuanqi Xu via cfe-commits
@@ -1249,3 +1249,5 @@ void ODRHash::AddQualType(QualType T) { void ODRHash::AddBoolean(bool Value) { Bools.push_back(Value); } + +void ODRHash::AddInteger(unsigned Value) { ID.AddInteger(Value); } ChuanqiXu9 wrote: Interesting. I didn't recognize this. If

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

2024-01-04 Thread Chuanqi Xu via cfe-commits
@@ -2431,10 +2434,14 @@ void ASTDeclReader::VisitClassTemplateDecl(ClassTemplateDecl *D) { mergeRedeclarableTemplate(D, Redecl); if (ThisDeclID == Redecl.getFirstID()) { -// This ClassTemplateDecl owns a CommonPtr; read it to keep track of all of -// the

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

2024-01-04 Thread Chuanqi Xu via cfe-commits
@@ -527,6 +527,10 @@ class ASTWriter : public ASTDeserializationListener, bool isLookupResultExternal(StoredDeclsList , DeclContext *DC); bool isLookupResultEntirelyExternal(StoredDeclsList , DeclContext *DC); + uint64_t + WriteSpecsLookupTable(NamedDecl *D,

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

2024-01-04 Thread Chuanqi Xu via cfe-commits
@@ -150,6 +150,11 @@ class ExternalASTSource : public RefCountedBase { virtual bool FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name); + /// Load all the external specialzations for the Decl and the corresponding + /// template arguments. +

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

2024-01-04 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > This is a great way to start a new year ;) > > The phab link is https://reviews.llvm.org/D41416. > > In general I was wondering could we simplify the implementation by loading > the specialization hash table upon module load. That should be relatively > cheap as we will

[clang] f5fd183 - [NFC] [C++20] [Modules] Remove pr60085.cppm with deprecated practice

2024-01-04 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-01-05T11:31:22+08:00 New Revision: f5fd1836836e0d37dea61cc842199713cc0e2fc4 URL: https://github.com/llvm/llvm-project/commit/f5fd1836836e0d37dea61cc842199713cc0e2fc4 DIFF: https://github.com/llvm/llvm-project/commit/f5fd1836836e0d37dea61cc842199713cc0e2fc4.diff

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

2024-01-04 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > Like I said in the commit message, this patch itself doesn't involve > > anything relevant to user interfaces. I left it to the latter patches. > > Are you in a position to post the next patch (at least as a draft)? That > would help me see the direction. I post it here

[clang] [C++20] [Modules] Implementing Eliding Unreachable Decls of GMF in ASTWriter (PR #76930)

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

[clang] [C++20] [Modules] Implementing Eliding Unreachable Decls of GMF in ASTWriter (PR #76930)

2024-01-04 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/76930 This was a patch to try to implement eliding unreachable decls in GMF in ASTWriter. It was developed a half year ago and I just rebased it but I did't fix the failing test. It ran well. The core idea of

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

2024-01-03 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > @ChuanqiXu9 very sorry for the slow review. It would help me if the design > was described in the commit message instead of trying to deduce it from the > patch (maybe it's in a thread somewhere - so a cross-reference would help). hi @iains , sorry for the confusion. It

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

2024-01-02 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/76774 >From 79cefc9f0f006acd788b6ac4e240c17d9deadf13 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 3 Jan 2024 11:33:17 +0800 Subject: [PATCH] Load Specializations Lazily ---

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

2024-01-02 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/76774 >From af6f8ca9b739c532a489881245fac1413ec84a07 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 3 Jan 2024 11:33:17 +0800 Subject: [PATCH] Load Specializations Lazily ---

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

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

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

2024-01-02 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/76774 The idea comes from @vgvassilev and @vgvassilev had patch for it on phab. Unfortunately phab is closed and I forgot the Dxxx number of that patch. But I remember the last comment from @vgvassilev is that we

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

2024-01-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @iains @dwblaikie 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] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-01-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @dwblaikie @rjmccall ping~ 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2024-01-01 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @sam-mccall ping~ what's the fate of the patch? https://github.com/llvm/llvm-project/pull/66462 ___ 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)

2023-12-28 Thread Chuanqi Xu via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" ChuanqiXu9 wrote: But "module: =" doesn't look

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

2023-12-28 Thread Chuanqi Xu via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" ChuanqiXu9 wrote: I don't get why we can't just

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

2023-12-28 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. ChuanqiXu9 wrote: Let's change the suffix of this file to `.cpp` https://github.com/llvm/llvm-project/pull/76451 ___

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

2023-12-28 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,9 @@ +// Test that -print-library-module-manifest-path finds the correct file. ChuanqiXu9 wrote: Let's change the suffix. https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list

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

2023-12-28 Thread Chuanqi Xu via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. + /// + /// \param C - The compilation.

[clang] 52770d8 - [Serialization] Don't pack bits for the function scope index of ParmVarDecl

2023-12-27 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2023-12-28T11:04:11+08:00 New Revision: 52770d83bf00fc56e9496e32f083f0f940bf7315 URL: https://github.com/llvm/llvm-project/commit/52770d83bf00fc56e9496e32f083f0f940bf7315 DIFF: https://github.com/llvm/llvm-project/commit/52770d83bf00fc56e9496e32f083f0f940bf7315.diff

[libcxx] [clang] [libc++] Re-enable the clang_modules_include test for Objective-C++ (PR #66801)

2023-12-27 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I tried to fix this in https://github.com/llvm/llvm-project/commit/c2c840bd92cfac155f6205ff7505b109b301d389. Sorry for disturbing. https://github.com/llvm/llvm-project/pull/66801 ___ cfe-commits mailing list

[clang] c2c840b - [Modules] Don't prevent @import from ObjectiveC

2023-12-27 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2023-12-28T10:45:47+08:00 New Revision: c2c840bd92cfac155f6205ff7505b109b301d389 URL: https://github.com/llvm/llvm-project/commit/c2c840bd92cfac155f6205ff7505b109b301d389 DIFF: https://github.com/llvm/llvm-project/commit/c2c840bd92cfac155f6205ff7505b109b301d389.diff

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

2023-12-27 Thread Chuanqi Xu via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. + /// + /// \param C - The compilation.

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

2023-12-27 Thread Chuanqi Xu via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" ChuanqiXu9 wrote: Do we need the prefix? I am

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

2023-12-27 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: %clang -print-library-module-manifest-path \ +// RUN: -stdlib=libc++ \ +// RUN: --sysroot=%S/Inputs/cxx23_modules \ +// RUN: --target=x86_64-linux-gnu 2>&1 \ +// RUN:

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

2023-12-27 Thread Chuanqi Xu via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. + /// + /// \param C - The compilation.

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

2023-12-27 Thread Chuanqi Xu via cfe-commits
@@ -5280,6 +5280,9 @@ def print_resource_dir : Flag<["-", "--"], "print-resource-dir">, def print_search_dirs : Flag<["-", "--"], "print-search-dirs">, HelpText<"Print the paths used for finding libraries and programs">, Visibility<[ClangOption, CLOption]>; +def

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

2023-12-27 Thread Chuanqi Xu via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. ChuanqiXu9 wrote:

[clang] Fix crash with modules and constexpr destructor (PR #69076)

2023-12-27 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I finally had time to debug this: The reason for modules being involved here > is because the serialization code calls `ParmVarDecl::getDefaultArg()` which > strips the outermost `FullExpr`, such as `ExprWithCleanups`. A potential fix > is in #76473 though I'm not really

[libcxx] [clang] [libc++] Re-enable the clang_modules_include test for Objective-C++ (PR #66801)

2023-12-27 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > https://reviews.llvm.org/D158694 The motivation of my change is that I find multiple people are trying to fake `import std` from clang modules. This is not wanted. So I tried to ban it. I'll try to fix it or revert it later today if I didn't.

[clang] 2203a4e - [NFC] [Serialization] Improve AST serialization by reordering packed

2023-12-21 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2023-12-21T16:35:20+08:00 New Revision: 2203a4e6e01ce6bfd69505420d304a81daf23dc9 URL: https://github.com/llvm/llvm-project/commit/2203a4e6e01ce6bfd69505420d304a81daf23dc9 DIFF: https://github.com/llvm/llvm-project/commit/2203a4e6e01ce6bfd69505420d304a81daf23dc9.diff

[clang] [Modules] [HeaderSearch] Don't reenter headers if it is pragma once (PR #76119)

2023-12-20 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/76119 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] [HeaderSearch] Don't reenter headers if it is pragma once (PR #76119)

2023-12-20 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/76119 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] [HeaderSearch] Don't reenter headers if it is pragma once o… (PR #76119)

2023-12-20 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/76119 …f #import Close https://github.com/llvm/llvm-project/issues/73023 The direct issue of https://github.com/llvm/llvm-project/issues/73023 is that we entered a header which is marked as pragma once since the

[clang] 565e5e8 - Recommit [NFC] [Serialization] Packing more bits and refactor AbbrevToUse

2023-12-20 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2023-12-21T10:30:12+08:00 New Revision: 565e5e861f64f455ab789bc50840e0be2d33c417 URL: https://github.com/llvm/llvm-project/commit/565e5e861f64f455ab789bc50840e0be2d33c417 DIFF: https://github.com/llvm/llvm-project/commit/565e5e861f64f455ab789bc50840e0be2d33c417.diff

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

2023-12-19 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,50 @@ +// REQUIRES: !system-windows + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: cd %t +// +// RUN: %clang_cc1 -std=c++20 %t/layer1.cppm -triple %itanium_abi_triple \ +// RUN: -emit-module-interface -o %t/foo-layer1.pcm +// RUN: %clang_cc1 -std=c++20

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

2023-12-19 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/75912 >From 908a0287e092ce7ac1865de32370ec3114b104ad Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 19 Dec 2023 17:00:59 +0800 Subject: [PATCH] [C++20] [Modules] [Itanium ABI] Generate the vtable in the

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

2023-12-19 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,50 @@ +// REQUIRES: !system-windows + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: cd %t +// +// RUN: %clang_cc1 -std=c++20 %t/layer1.cppm -triple %itanium_abi_triple \ +// RUN: -emit-module-interface -o %t/foo-layer1.pcm +// RUN: %clang_cc1 -std=c++20

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

2023-12-19 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,50 @@ +// REQUIRES: !system-windows + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: cd %t +// +// RUN: %clang_cc1 -std=c++20 %t/layer1.cppm -triple %itanium_abi_triple \ +// RUN: -emit-module-interface -o %t/foo-layer1.pcm +// RUN: %clang_cc1 -std=c++20

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