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

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,141 @@ +//===- PrerequisiteModules.h -*- +//C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

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

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,141 @@ +//===- PrerequisiteModules.h -*- +//C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

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

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,78 @@ +//=== ModuleDependencyScanner.cpp *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,278 @@ +//===- PrerequisiteModules.cpp ---*- +//C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

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

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,278 @@ +//===- PrerequisiteModules.cpp ---*- +//C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

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

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -104,6 +107,8 @@ struct PreambleData { IncludeStructure Includes; // Captures #include-mapping information in #included headers. std::shared_ptr Pragmas; + // Information about module files for this preamble. + std::optional DependentModulesInfo;

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

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,90 @@ +//===-- ModuleDependencyScanner.h *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,90 @@ +//===-- ModuleDependencyScanner.h *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,78 @@ +//=== ModuleDependencyScanner.cpp *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,78 @@ +//=== ModuleDependencyScanner.cpp *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,278 @@ +//===- PrerequisiteModules.cpp ---*- +//C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

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

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -104,6 +107,8 @@ struct PreambleData { IncludeStructure Includes; // Captures #include-mapping information in #included headers. std::shared_ptr Pragmas; + // Information about module files for this preamble. + std::optional DependentModulesInfo;

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

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -587,11 +587,11 @@ class DiagPatcher { }; } // namespace -std::shared_ptr -buildPreamble(PathRef FileName, CompilerInvocation CI, - const ParseInputs , bool StoreInMemory, - PreambleParsedCallback PreambleCallback, -

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

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,55 @@ +//===-- ProjectModules.h -*- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,141 @@ +//===- PrerequisiteModules.h -*- +//C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

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

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,78 @@ +//=== ModuleDependencyScanner.cpp *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-31 Thread Chuanqi Xu via cfe-commits
@@ -696,6 +698,19 @@ buildPreamble(PathRef FileName, CompilerInvocation CI, Result->Includes = CapturedInfo.takeIncludes(); Result->Pragmas = std::make_shared( CapturedInfo.takePragmaIncludes()); + +if (ExperimentalModulesSupport) { + WallTimer

[clang] [clang-scan-deps] [P1689] Keep consistent behavior for make dependencies with clang (PR #69551)

2023-10-29 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Thanks for the ping, I had missed your question > > > How do you think about the idea to add a flag to the MDC about whether or > > not calling makeAbsoluteAndPreferred? > > SGTM; this seems like a good compromise since we can't easily extract this > into the consumer.

[clang] [clang-scan-deps] [P1689] Keep consistent behavior for make dependencies with clang (PR #69551)

2023-10-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69551 >From c91007b51e164d22c8f73a864105494ebc10a004 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 30 Oct 2023 11:51:04 +0800 Subject: [PATCH] [clang-scan-deps] [P1689] Keep consistent behavior for make

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-29 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @Bigcheese ping https://github.com/llvm/llvm-project/pull/69555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 2204364 - [docs] [C++20] [Modules] Add document for the case of duplicated '-fmodule-file=='

2023-10-29 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2023-10-30T11:25:21+08:00 New Revision: 22043643c64f748cb00ae92476f2085b3c0903c9 URL: https://github.com/llvm/llvm-project/commit/22043643c64f748cb00ae92476f2085b3c0903c9 DIFF: https://github.com/llvm/llvm-project/commit/22043643c64f748cb00ae92476f2085b3c0903c9.diff

[clang] e9a7876 - [C++20] [Modules] Chose BMI from for module m with the last

2023-10-27 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2023-10-27T16:52:21+08:00 New Revision: e9a7876c2c81423f2289aa85eeac32d7a55cd3c8 URL: https://github.com/llvm/llvm-project/commit/e9a7876c2c81423f2289aa85eeac32d7a55cd3c8 DIFF: https://github.com/llvm/llvm-project/commit/e9a7876c2c81423f2289aa85eeac32d7a55cd3c8.diff

[clang] [clang-scan-deps] [P1689] Keep consistent behavior for make dependencies with clang (PR #69551)

2023-10-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @benlangmuir ping~ https://github.com/llvm/llvm-project/pull/69551 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose use of VLAs in a coroutine (PR #70341)

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

[clang] Diagnose use of VLAs in a coroutine (PR #70341)

2023-10-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > LGTM but it is missing a release note :) it may be fine to not mention it clearly since VLAs in coroutines never got compiled.. user might meet backend crashes.. https://github.com/llvm/llvm-project/pull/70341 ___ cfe-commits

[clang] Diagnose use of VLAs in a coroutine (PR #70341)

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

[clang] Diagnose use of VLAs in a coroutine (PR #70341)

2023-10-26 Thread Chuanqi Xu via cfe-commits
@@ -1198,6 +1198,11 @@ void Sema::CheckCompletedCoroutineBody(FunctionDecl *FD, Stmt *) { if (FD->hasAttr()) Diag(FD->getLocation(), diag::warn_always_inline_coroutine); + // We don't allow use of VLAs within a coroutine, so diagnose if we've seen

[clang] Diagnose use of VLAs in a coroutine (PR #70341)

2023-10-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. Thanks! LGTM with a nit. https://github.com/llvm/llvm-project/pull/70341 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [Serializer] Pack information in serializer (PR #69287)

2023-10-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69287 >From ae4ee482f5b6b5d2487ed642b92e513ffd269781 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 16 Oct 2023 16:41:31 +0800 Subject: [PATCH] [Serializer] Pack bits into integers Previously, the boolean

[clang] [NFC] [Serializer] Pack information in serializer (PR #69287)

2023-10-26 Thread Chuanqi Xu via cfe-commits
@@ -617,24 +617,27 @@ void ASTDeclReader::VisitDecl(Decl *D) { Reader.getContext()); } D->setLocation(ThisDeclLoc); - D->InvalidDecl = Record.readInt(); - if (Record.readInt()) { // hasAttrs + + uint64_t DeclBits = Record.readInt(); +

[clang] [NFC] [Serializer] Pack information in serializer (PR #69287)

2023-10-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69287 >From e99fc1ab1e609d8e69c5d60b4c5df3f5563273e3 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 16 Oct 2023 16:41:31 +0800 Subject: [PATCH] [Serializer] Pack bits into integers Previously, the boolean

[clang] [NFC] [Serializer] Pack information in serializer (PR #69287)

2023-10-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69287 >From 5a1f32f156801da271486dbb0fd37007adb4901c Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 16 Oct 2023 16:41:31 +0800 Subject: [PATCH 1/4] [NFC] [Serializer] Pack information in serializer

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. Consistency is good. https://github.com/llvm/llvm-project/pull/70296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Skip slow `UNHASHED_CONTROL_BLOCK` records (PR #69975)

2023-10-25 Thread Chuanqi Xu via cfe-commits
@@ -219,6 +219,12 @@ class HeaderSearchOptions { unsigned ModulesValidateDiagnosticOptions : 1; + /// Whether to entirely skip writing diagnostic options. + unsigned ModulesSkipDiagnosticOptions : 1; + + /// Whether to entirely skip writing header search paths.

[clang-tools-extra] [RFC] Perform lifetime bound checks for arguments to coroutine (PR #69360)

2023-10-25 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,184 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++20 -fsyntax-only -verify -Wall -Wextra -Wno-error=unreachable-code -Wno-unused + +#include "Inputs/std-coroutine.h" + +using std::suspend_always; +using std::suspend_never; + + +#define CORO_TYPE

[clang] [RFC] Perform lifetime bound checks for arguments to coroutine (PR #69360)

2023-10-25 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Thanks for bringing this! I didn't notice the post in discourse and I'll put higher level comments there. https://github.com/llvm/llvm-project/pull/69360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [RFC] Perform lifetime bound checks for arguments to coroutine (PR #69360)

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

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

2023-10-25 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: While the change itself looks neat, I am curious about the reason how this interact with modules. https://github.com/llvm/llvm-project/pull/69076 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [NFC] [Serializer] Pack information in serializer (PR #69287)

2023-10-25 Thread Chuanqi Xu via cfe-commits
@@ -617,24 +617,27 @@ void ASTDeclReader::VisitDecl(Decl *D) { Reader.getContext()); } D->setLocation(ThisDeclLoc); - D->InvalidDecl = Record.readInt(); - if (Record.readInt()) { // hasAttrs + + uint64_t DeclBits = Record.readInt(); +

[clang] [NFC] [Serializer] Pack information in serializer (PR #69287)

2023-10-24 Thread Chuanqi Xu via cfe-commits
@@ -617,24 +617,27 @@ void ASTDeclReader::VisitDecl(Decl *D) { Reader.getContext()); } D->setLocation(ThisDeclLoc); - D->InvalidDecl = Record.readInt(); - if (Record.readInt()) { // hasAttrs + + uint64_t DeclBits = Record.readInt(); +

[clang] [NFC] [Serializer] Pack information in serializer (PR #69287)

2023-10-23 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @zygoloid @vgvassilev ping~ Personally I feel like the change itself should be safe. (The test for modules is really sensitive about the changes in Serializer) https://github.com/llvm/llvm-project/pull/69287 ___ cfe-commits mailing

[clang] [clang][deps] Skip slow `UNHASHED_CONTROL_BLOCK` records (PR #69975)

2023-10-23 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Besides deps scanning, have you tried to enable these option to compile with clang modules? I mean, if it is safe to enable such options at compilation times, it looks a valid optimization for C++20 modules too. If it is not safe to do so, I think we

[clang] [C++20] [Modules] [Driver] Don't enable -fdelayed-template-parsing by default on windows with C++20 modules (PR #69431)

2023-10-23 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Yeah, this is the reason why I put the change in `C++ Specific Potentially Breaking Changes` section. I think specify `-fdelayed-template-parsing` explicitly may be a good solution/workaroud. https://github.com/llvm/llvm-project/pull/69431

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

2023-10-22 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @sam-mccall gentle ping~ 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] [C++20] [Modules] [Driver] Don't enable -fdelayed-template-parsing by default on windows with C++20 modules (PR #69431)

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

[clang] [C++20] [Modules] [Driver] Don't enable -fdelayed-template-parsing by default on windows with C++20 modules (PR #69431)

2023-10-22 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Comments addressed. https://github.com/llvm/llvm-project/pull/69431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] [Driver] Don't enable -fdelayed-template-parsing by default on windows with C++20 modules (PR #69431)

2023-10-22 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69431 >From 9c0d81ef5fdae40d378170eebd848f099902dc98 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 18 Oct 2023 15:58:03 +0800 Subject: [PATCH] [C++20] [Modules] [Driver] Don't enable

[clang] [C++20] [Modules] [Driver] Don't enable -fdelayed-template-parsing by default on windows with C++20 modules (PR #69431)

2023-10-20 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > I still support disabling delayed template parsing by default in all > > > configurations. Ultimately, this feature is a source of bugs, and we > > > should start the clock on its deprecation and removal. This, of course, > > > involves real work, and I haven't

[clang] [C++20] [Modules] [Driver] Don't enable -fdelayed-template-parsing by default on windows with C++20 modules (PR #69431)

2023-10-20 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69431 >From 076f2ea9de7d0f979431363b5426931239c7c494 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 18 Oct 2023 15:58:03 +0800 Subject: [PATCH] [C++20] [Modules] [Driver] Don't enable

[clang] [clang-scan-deps] [P1689] Keep consistent behavior for make dependencies with clang (PR #69551)

2023-10-20 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Is the issue with MDC's FileDeps that we are calling > `makeAbsoluteAndPreferred` on the paths? Maybe we could instead move that > call into `FullDependencyConsumer`. Or are there other issues? > > The fact we need to add additional `MDC.IsStdModuleP1689Format` checks in

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69555 >From 86663a35a7af039f9440af2cc1896e8b4cf33310 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 19 Oct 2023 11:28:01 +0800 Subject: [PATCH 1/3] [C++20] [Modules] Warn if we found #include in module

[clang] [C++20] [Modules] [Driver] Don't enable -fdelayed-template-parsing by default on windows with C++20 modules (PR #69431)

2023-10-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > According to the docs [0], MSVC actually defaults to > `-fno-delayed-template-parsing` (`/Zc:twoPhase-` with MSVC CLI) if using > C++20. This is due to `-std:c++20` implying `/permissive-` which implies > `/Zc:twoPhase-`. We could therefore just disable it based on

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > (in this context) Framework headers are like system (or user headers) but > searched by a different mechanism (so they are #include-ed). In principle, > the same constraints should apply - indicates a "system" > header and probably should not be included in the module

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Chuanqi Xu via cfe-commits
@@ -922,6 +922,10 @@ def err_header_import_semi_in_macro : Error< def err_header_import_not_header_unit : Error< "header file %0 (aka '%1') cannot be imported because " "it is not known to be a header unit">; +def warn_pp_include_angled_in_module_purview : Warning< +

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69555 >From 86663a35a7af039f9440af2cc1896e8b4cf33310 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 19 Oct 2023 11:28:01 +0800 Subject: [PATCH 1/2] [C++20] [Modules] Warn if we found #include in module

[clang] [C++20] [Modules] [Driver] Don't enable -fdelayed-template-parsing by default on windows with C++20 modules (PR #69431)

2023-10-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Is delayed template parsing an optimisation or a correctness measure? If it's > an optimisation, then it seems that we should disable it for modules (because > that then makes the modules cases correct). If it's needed for correctness, > then we have more of a problem -

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > When I suggested this, it was an intention to limit it to C++ std library > headers. Do we not have some existing mechanism that knows which headers are > in this category (for typo correction etc?) As far as I can reach, we don't have such a mechanism. I was wondering if

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Chuanqi Xu via cfe-commits
@@ -922,6 +922,10 @@ def err_header_import_semi_in_macro : Error< def err_header_import_not_header_unit : Error< "header file %0 (aka '%1') cannot be imported because " "it is not known to be a header unit">; +def warn_pp_include_angled_in_module_purview : Warning< +

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69555 >From 86663a35a7af039f9440af2cc1896e8b4cf33310 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 19 Oct 2023 11:28:01 +0800 Subject: [PATCH] [C++20] [Modules] Warn if we found #include in module purview

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/69555 Close https://github.com/llvm/llvm-project/issues/68615. It is generally wrong to include in the module purview. Although there are cases to include files in the module purview, generally these use cases

[clang] [clang-scan-deps] [P1689] Keep consistent behavior for make dependencies with clang (PR #69551)

2023-10-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/69551 Close https://github.com/llvm/llvm-project/issues/69439. This patch tries to reuse the codes to generate make style dependencies information with P1689 format directly. >From

[clang] [C++20] [Modules] [Driver] Don't enable -fdelayed-template-parsing by default on windows with C++20 modules (PR #69431)

2023-10-18 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Does MSVC have the delayed template parsing effects when using modules? If > not, perhaps we should just disable the flag/not allow it to be composed > together? As far as I can reach, (from the issue reports in MSVC community), MSVC don't have problems with the delayed

[clang] [C++20] [Modules] [Driver] Don't enable -fdelayed-template-parsing by default on windows with C++20 modules (PR #69431)

2023-10-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/69431 There are already 3 issues about the broken state of -fdelayed-template-parsing and C++20 modules: - https://github.com/llvm/llvm-project/issues/61068 - https://github.com/llvm/llvm-project/issues/64810 -

[clang] [NFC] [Serializer] Pack information in serializer (PR #69287)

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

[clang] [NFC] [Serializer] Pack information in serializer (PR #69287)

2023-10-17 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69287 >From 5a1f32f156801da271486dbb0fd37007adb4901c Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 16 Oct 2023 16:41:31 +0800 Subject: [PATCH] [NFC] [Serializer] Pack information in serializer Previously,

[clang] [NFC] [Serializer] Pack information in serializer (PR #69287)

2023-10-16 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69287 >From 326bc3a4a24cfd515f2673e5a01bd30b3b1bf6bc Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 16 Oct 2023 16:41:31 +0800 Subject: [PATCH] [NFC] [Serializer] Pack information in serializer Previously,

[clang] [NFC] [Serializer] Pack information in serializer (PR #69287)

2023-10-16 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/69287 Previously, the boolean values will occupy spaces that can contain integers. It wastes the spaces especially if the boolean values are serialized consecutively. The patch tries to pack such consecutive

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

2023-10-16 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I highly recommend talking to @mathstuf of the CMake project about a way for > the build system can emit a next generation set of build graph metadata > (think modules appropriate compile commands, including dependencies). > > I expect it will be more efficient for the

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

2023-10-16 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @sam-mccall gentle ping~ 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] be72dca - [docs] [C++20] [Modules] Mentioning that -fdelayed-template-parsing is not working with modules

2023-10-15 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2023-10-16T10:38:33+08:00 New Revision: be72dca5e3ab3301e6927aca1c0823e382519bb3 URL: https://github.com/llvm/llvm-project/commit/be72dca5e3ab3301e6927aca1c0823e382519bb3 DIFF: https://github.com/llvm/llvm-project/commit/be72dca5e3ab3301e6927aca1c0823e382519bb3.diff

[clang] [C++20] [Modules] Don't emit function bodies which is noinline and av… (PR #68501)

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

[clang] [C++20] [Modules] Don't emit function bodies which is noinline and av… (PR #68501)

2023-10-09 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Yeah, of course. https://github.com/llvm/llvm-project/pull/68501 ___ 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)

2023-10-09 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @sam-mccall thanks for your high qualified comments! I think I've addressed most of them. I am not so familiar with the Github review system. Tell me if you're more happy with other practices. https://github.com/llvm/llvm-project/pull/66462

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

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,282 @@ +//===- ModuleFilesInfo.cpp ---*- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,282 @@ +//===- ModuleFilesInfo.cpp ---*- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,282 @@ +//===- ModuleFilesInfo.cpp ---*- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,118 @@ +//===- ModuleFilesInfo.h -*- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,118 @@ +//===- ModuleFilesInfo.h -*- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,118 @@ +//===- ModuleFilesInfo.h -*- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,118 @@ +//===- ModuleFilesInfo.h -*- C++-*-===// ChuanqiXu9 wrote: Done by renaming. I don't quite understand the sentence "the modules are the inputs for something in particular.".

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

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,118 @@ +//===- ModuleFilesInfo.h -*- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,78 @@ +//===-- ModuleDependencyScanner.h *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,78 @@ +//===-- ModuleDependencyScanner.h *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,118 @@ +//===- ModuleFilesInfo.h -*- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,118 @@ +//===- ModuleFilesInfo.h -*- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,118 @@ +//===- ModuleFilesInfo.h -*- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -442,6 +448,9 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs , std::move(CI), PreamblePCH, llvm::MemoryBuffer::getMemBufferCopy(Inputs.Contents, Filename), VFS, *DiagConsumer); + + // Clangd Modules TODO: refactor the command line

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

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,78 @@ +//===-- ModuleDependencyScanner.h *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,78 @@ +//===-- ModuleDependencyScanner.h *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,78 @@ +//===-- ModuleDependencyScanner.h *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,78 @@ +//===-- ModuleDependencyScanner.h *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,78 @@ +//===-- ModuleDependencyScanner.h *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,78 @@ +//===-- ModuleDependencyScanner.h *- 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-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-10-09 Thread Chuanqi Xu via cfe-commits
@@ -45,6 +45,10 @@ class GlobalCompilationDatabase { return std::nullopt; } + virtual std::vector getAllFilesInProjectOf(PathRef File) const { ChuanqiXu9 wrote: Done by adding ProjectModules class in ProjectModules.cpp file.

[clang] [C++20] [Modules] Don't emit function bodies which is noinline and av… (PR #68501)

2023-10-08 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > This doesn't seem all that useful/important to me - a user can move the body > of the function into an implementation unit rather than putting it in the > interface unit and marking it noinline, right? This is the same > recommendation we'd make if someone wrote a complex

[clang] [C++20] [Modules] Don't emit function bodies which is noinline and av… (PR #68501)

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

[clang] [C++20] [Modules] Don't emit function bodies which is noinline and av… (PR #68501)

2023-10-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/68501 …ailabl externally A workaround for https://github.com/llvm/llvm-project/issues/60996 As the title suggested, we can avoid emitting available externally functions which is marked as noinline already. Such

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

2023-10-07 Thread Chuanqi Xu via cfe-commits
@@ -45,6 +45,10 @@ class GlobalCompilationDatabase { return std::nullopt; } + virtual std::vector getAllFilesInProjectOf(PathRef File) const { ChuanqiXu9 wrote: Where is the example for `module_commands.json`? So that we can get a rough image.

[clang] [clang][Modules] Make `Module::Requirement` a struct (PR #67900)

2023-10-07 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Would someone be able to merge this for me? I do not have permission. Sorry for not merging this in time. Could you rebase again since it has conflicts now. https://github.com/llvm/llvm-project/pull/67900 ___ cfe-commits mailing

<    4   5   6   7   8   9   10   11   12   13   >