[clang] [clang-scan-deps] Don't inspect Args[0] as an option (PR #109050)

2024-09-19 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. https://github.com/llvm/llvm-project/pull/109050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Make deprecations of some `FileManager` APIs formal (PR #110014)

2024-09-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/110014 Some `FileManager` APIs still return `{File,Directory}Entry` instead of the preferred `{File,Directory}EntryRef`. These are documented to be deprecated, but don't have the attribute that warns on their usa

[clang] [clang-tools-extra] [clang] Make deprecations of some `FileManager` APIs formal (PR #110014)

2024-09-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/110014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] c71bfc5 - [clang] Fix FileManagerTest

2024-09-25 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2024-09-25T10:54:40-07:00 New Revision: c71bfc59ee1cec32d56a82476461e242398f82ca URL: https://github.com/llvm/llvm-project/commit/c71bfc59ee1cec32d56a82476461e242398f82ca DIFF: https://github.com/llvm/llvm-project/commit/c71bfc59ee1cec32d56a82476461e242398f82ca.diff L

[clang] [clang-tools-extra] [clang] Make deprecations of some `FileManager` APIs formal (PR #110014)

2024-09-25 Thread Jan Svoboda via cfe-commits
@@ -1925,8 +1921,8 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( M = HS.lookupModule(ModuleName, ImportLoc, true, !IsInclusionDirective); // Check whether M refers to the file in the prebuilt module path. -if (M && M->getASTFile()) - if

[clang] [clang-tools-extra] [clang] Make deprecations of some `FileManager` APIs formal (PR #110014)

2024-09-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/110014 >From 6b413a95887bb12cf7bae647173dd7b3c6a47684 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Mon, 23 Sep 2024 17:00:48 -0700 Subject: [PATCH 1/5] [clang] Formally deprecate `FileManager::getFile()` ---

[clang] [clang][serialization] Pass `ASTContext` explicitly (PR #115235)

2024-11-06 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/115235 This patch removes `ASTWriter::Context` and starts passing `ASTContext &` explicitly to functions that actually need it. This is a non-functional change with the end-goal of being able to write lightweight

[clang] [clang][serialization] Make `ASTWriter` work with `Preprocessor` only (PR #115237)

2024-11-06 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/115237 This PR builds on top of https://github.com/llvm/llvm-project/pull/115235 and makes it possible to call `ASTWriter::WriteAST()` with `Preprocessor` only instead of full `Sema` object. So far, there are no

[clang] [clang][serialization] Pass `ASTContext` explicitly (PR #115235)

2024-11-06 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: To clarify, the main reason for this patch is that I find passing a reference much less error-prone than having an omnipresent pointer that will only be null during dependency scanning. https://github.com/llvm/llvm-project/pull/115235 ___

[clang] [clang][deps] Only write preprocessor info into PCMs (PR #115239)

2024-11-06 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/115239 This patch builds on top of https://github.com/llvm/llvm-project/pull/115237 and https://github.com/llvm/llvm-project/pull/115235, only passing the `Preprocessor` object to `ASTWriter`. This reduces the si

[clang] 304c412 - [clang][serialization] Reduce `ASTWriter::writeUnhashedControlBlock()` scope

2024-11-06 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2024-11-06T12:54:01-08:00 New Revision: 304c41217303ce613de8f4042e570ac6ca8757e8 URL: https://github.com/llvm/llvm-project/commit/304c41217303ce613de8f4042e570ac6ca8757e8 DIFF: https://github.com/llvm/llvm-project/commit/304c41217303ce613de8f4042e570ac6ca8757e8.diff L

[clang] bcb64e1 - [clang][serialization] Reduce `ASTWriter::WriteSourceManagerBlock()` scope

2024-11-06 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2024-11-06T12:34:24-08:00 New Revision: bcb64e13172c9b894be03ccefcf967e99949b32a URL: https://github.com/llvm/llvm-project/commit/bcb64e13172c9b894be03ccefcf967e99949b32a DIFF: https://github.com/llvm/llvm-project/commit/bcb64e13172c9b894be03ccefcf967e99949b32a.diff L

[clang] 0276621 - [clang][serialization] Reduce `ASTWriter::WriteControlBlock()` scope

2024-11-06 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2024-11-06T12:36:46-08:00 New Revision: 0276621f8f5ae489fbe9343cb4cca07579a244a4 URL: https://github.com/llvm/llvm-project/commit/0276621f8f5ae489fbe9343cb4cca07579a244a4 DIFF: https://github.com/llvm/llvm-project/commit/0276621f8f5ae489fbe9343cb4cca07579a244a4.diff L

[clang] [clang][serialization] Pass `ASTContext` explicitly (PR #115235)

2024-11-07 Thread Jan Svoboda via cfe-commits
@@ -4753,15 +4755,12 @@ void ASTWriter::AddString(StringRef Str, RecordDataImpl &Record) { } bool ASTWriter::PreparePathForOutput(SmallVectorImpl &Path) { - assert(Context && "should have context when outputting path"); - // Leave special file names as they are. String

[clang] [ASTWriter] Detect more non-affecting FileIDs to reduce source location duplication (PR #112015)

2024-11-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. Sounds good, thank you! https://github.com/llvm/llvm-project/pull/112015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][serialization] Pass `ASTContext` explicitly (PR #115235)

2024-11-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/115235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][serialization] Make `ASTWriter` work with `Preprocessor` only (PR #115237)

2024-11-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/115237 >From 24f60890a4a1cef2c9387040fce6d0864fcb01f4 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 6 Nov 2024 11:18:09 -0800 Subject: [PATCH] [clang][serialization] Make `ASTWriter` accept `Preprocessor`

[clang] [clang][serialization] Enable `ASTWriter` to work with `Preprocessor` only (PR #115237)

2024-11-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 edited https://github.com/llvm/llvm-project/pull/115237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][serialization] Pass `ASTContext` explicitly (PR #115235)

2024-11-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/115235 >From 27985cf8df00f1edf6e74b7e50ce5be13569591c Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 6 Nov 2024 09:54:06 -0800 Subject: [PATCH 1/3] [clang][serialization] Pass `ASTContext` explicitly ---

[clang] [clang][serialization] Enable `ASTWriter` to work with `Preprocessor` only (PR #115237)

2024-11-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/115237 >From 24f60890a4a1cef2c9387040fce6d0864fcb01f4 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 6 Nov 2024 11:18:09 -0800 Subject: [PATCH 1/2] [clang][serialization] Make `ASTWriter` accept `Preproces

[clang] [clang][modules] Only serialize info for locally-included headers (PR #113718)

2024-10-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/113718 I noticed that some PCM files contain `HeaderFileInfo` for headers only included in a dependent PCM file, which is wasteful. This patch changes the logic to only write headers that are included locally. T

[clang] 75252e2 - [clang][serialization] Bump `NUM_PREDEF_TYPE_IDS`

2024-10-25 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2024-10-25T12:40:59-07:00 New Revision: 75252e29ea6a0959f3c1670e641a03fc18fc65fa URL: https://github.com/llvm/llvm-project/commit/75252e29ea6a0959f3c1670e641a03fc18fc65fa DIFF: https://github.com/llvm/llvm-project/commit/75252e29ea6a0959f3c1670e641a03fc18fc65fa.diff L

[clang] [llvm] [AMDGPU] Add a type for the named barrier (PR #113614)

2024-10-25 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: I just pushed a fix in 75252e2. https://github.com/llvm/llvm-project/pull/113614 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG] bump NUM_PREDEF_TYPE_IDS (PR #113728)

2024-10-25 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Already fixed in 75252e29ea6a0959f3c1670e641a03fc18fc65fa. https://github.com/llvm/llvm-project/pull/113728 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Add a type for the named barrier (PR #113614)

2024-10-25 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: This PR did bump `NUM_PREDEF_TYPE_IDS`, but after the pre-merge tests succeeded, #97277 that also bumps `NUM_PREDEF_TYPE_IDS ` landed in `main`. https://github.com/llvm/llvm-project/pull/113614 ___ cfe-commits mailing list cfe-comm

[clang] [clang-tools-extra] [clang][modules] Shrink the size of `Module::Headers` (PR #113395)

2024-10-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/113395 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][modules] Shrink the size of `Module::Headers` (PR #113395)

2024-10-25 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/113395 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Improve timing output (PR #113726)

2024-10-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/113726 This patch adds the number of executed instructions into the timing output, which provides more stable results compared to wall or process time. The format itself is also tweaked so that it's more amenable

[clang] [clang][modules] Only serialize info for locally-included headers (PR #113718)

2024-10-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/113718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTWriter] Detect more non-affecting FileIDs to reduce source location duplication (PR #112015)

2024-10-15 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: I was looking at the affecting module map logic for a reason unrelated to yours, but ended up needing something similar to what you're trying to achieve. Here's an example: ``` //--- X1.modulemap module X1 { header "X1.h" } //--- X2.modulemap module X2 { header "X2.h" } //-

[clang] [clang][modules] Timestamp PCM files when writing (PR #112452)

2024-10-15 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/112452 Clang uses timestamp files to track the last time an implicitly-built PCM file was verified to be up-to-date with regard to its inputs. With `-fbuild-session-{file,timestamp}=` and `-fmodules-validate-on

[clang] [clang][modules] Timestamp PCM files when writing (PR #112452)

2024-10-15 Thread Jan Svoboda via cfe-commits
@@ -4905,6 +4905,10 @@ ASTFileSignature ASTWriter::WriteAST(Sema &SemaRef, StringRef OutputFile, this->BaseDirectory.clear(); WritingAST = false; + + if (WritingModule) +updateModuleTimestamp(OutputFile); jansvoboda11 wrote: Calling this here is a b

[clang] [ASTWriter] Detect more non-affecting FileIDs to reduce source location duplication (PR #112015)

2024-10-15 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 edited https://github.com/llvm/llvm-project/pull/112015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTWriter] Detect more non-affecting FileIDs to reduce source location duplication (PR #112015)

2024-10-15 Thread Jan Svoboda via cfe-commits
@@ -43,7 +43,7 @@ module third {} // CHECK-NEXT: "command-line": [ // CHECK-NEXT: "-cc1", // CHECK: "-fmodule-map-file=[[PREFIX]]/second/second/module.modulemap" -// CHECK-NOT: "-fmodule-map-file=[[PREFIX]]/second/second/sub.modulemap" +//

[clang] [ASTWriter] Detect more non-affecting FileIDs to reduce source location duplication (PR #112015)

2024-10-15 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 commented: Thanks for trying to find an alternative solution! > However, when reading the .pcm files, we will reuse the FileID loaded from it > for the same module map file and the FileID we created can never be used > again, but we will still not mark it as aff

[clang] [clang] Fix ASTWriter crash after merging named enums (PR #114240)

2024-11-07 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > @jansvoboda11 for OC related things Thanks! CC @vsapsai and @ian-twilightcoder. https://github.com/llvm/llvm-project/pull/114240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang][deps] Share `FileManager` between modules (PR #115065)

2024-11-06 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/115065 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][serialization] Blobify IMPORTS strings and signatures (PR #116095)

2024-11-18 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/116095 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][serialization] Blobify IMPORTS strings and signatures (PR #116095)

2024-11-18 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/116095 >From 3d50eff35fe68cfa7d94d27ccd51e9d1b864417a Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 13 Nov 2024 11:17:14 -0800 Subject: [PATCH 1/2] [clang][serialization] Blobify IMPORTS strings and signa

[clang] [ASTWriter] Do not allocate source location space for module maps used only for textual headers (PR #116374)

2024-11-20 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Does preprocessing from AST files (ab75597ddac52f24e9cbd794cded195262ef670e) with decluse checking (f3f846162a5d6b5b84ed7d146a29dc175542c2c0) still work with this patch? I'm surprised that removing of module maps just because they only provided a textual header doesn't have

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

2025-02-11 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: The idea here makes sense to me and I don't mind if it lands without "NFC" in the title, but I think enforcing this at compile time would be more robust. Could we use `static_assert` with something like `llvm::BitWidth` and supporting infrastructure from `llvm/include/ADT/B

[clang] [clang] Assert the enum FPOpts and LangOpts fit into the storage (PR #126166)

2025-02-11 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. Ok, makes sense to fix the immediate problem now and follow up with the more robust fix later. Would be good if you could leave a FIXME on one of the `assert` calls in `LangOptions.h` outlining the potential improvement via `static_as

[clang] [clang] Rename ReadPCHAndPreprocessAction (NFC) (PR #122390)

2025-02-11 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: I agree that the name can be confusing. I think the original motivation for this name was to avoid spreading the concept of modular dependency scanning through the Clang codebase. Could we move this class into `Tooling/DependencyScanning` to keep that concept self-contained

[clang] [ASTWriter] Do not allocate source location space for module maps used only for textual headers (PR #116374)

2025-02-11 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Hi @ilya-biryukov, I wanted to apologize for the late reply (I was on a leave) and thank you for going through the test case and taking time to understand why it works. Sounds good! https://github.com/llvm/llvm-project/pull/116374 ___

[clang] clang: Relax LangOpts checks when lexing quoted numbers during preprocessing (PR #95798)

2024-11-21 Thread Jan Svoboda via cfe-commits
@@ -2068,7 +2068,8 @@ bool Lexer::LexNumericConstant(Token &Result, const char *CurPtr) { } // If we have a digit separator, continue. - if (C == '\'' && (LangOpts.CPlusPlus14 || LangOpts.C23)) { + if (C == '\'' && + (LangOpts.CPlusPlus14 || LangOpts.C23 || Parsing

[clang] Pass LangOpts from CompilerInstance to DependencyScanningWorker (PR #93753)

2024-11-21 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > But the list of tokens depends on things like what features are enabled, > right? e.g., `-fchar8_t` introduces a new keyword, while `_Atomic` isn't a > keyword in OpenCL, and `bool` is only a keyword in C23 and later but is > always a keyword in C++, etc. Ah, but in terms

[clang] [clang][modules] Fix filesystem races in `ModuleManager` (PR #131354)

2025-03-15 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 edited https://github.com/llvm/llvm-project/pull/131354 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Support] Introduce new `AdvisoryLock` interface (PR #130989)

2025-03-15 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/130989 This PR abstracts the `LockFileManager` API into new `AdvisoryLock` interface. This is so that we can create an alternative implementation for Clang implicitly-built modules that is optimized for single-pr

[clang] [clang][modules] Fix filesystem races in `ModuleManager` (PR #131354)

2025-03-19 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/131354 >From 7e5de89fa20b9fe7c07ab0d05a5caaec3ac31255 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Mon, 17 Mar 2025 08:11:52 -0700 Subject: [PATCH 1/2] [clang][modules] Fix filesystem races in `ModuleManager`

[clang] [clang] Remove deprecated `FileManager` APIs (PR #132063)

2025-03-19 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/132063 This PR removes the `FileManager` APIs that have been deprecated for a while. LLVM 20.1.0 that was released earlier this month contains the formal deprecation of these APIs, so these should be fine to remo

[clang] [clang][deps] Implement efficient in-process `ModuleCache` (PR #129751)

2025-03-18 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/129751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Implement efficient in-process `ModuleCache` (PR #129751)

2025-03-18 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 edited https://github.com/llvm/llvm-project/pull/129751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove deprecated `FileManager` APIs (PR #132063)

2025-03-20 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/132063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] da1c19a - [clang][deps] Add missing include

2025-03-20 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2025-03-19T11:31:54-07:00 New Revision: da1c19af7e8482a0357fe896ac77232c859837e7 URL: https://github.com/llvm/llvm-project/commit/da1c19af7e8482a0357fe896ac77232c859837e7 DIFF: https://github.com/llvm/llvm-project/commit/da1c19af7e8482a0357fe896ac77232c859837e7.diff L

[clang] [clang] NFCI: Mutate `HeaderSearchOptions` earlier (PR #130823)

2025-03-21 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/130823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Make `HeaderSearchOptions` references const (PR #130825)

2025-03-21 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/130825 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][lex] Store non-owning options ref in `HeaderSearch` (PR #132780)

2025-03-24 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/132780 This makes it so that `CompilerInvocation` can be the only entity that manages ownership of `HeaderSearchOptions`, making it possible to implement copy-on-write semantics. >From 4fe58f967f21c790c179d4c37e

[clang] [clang][modules] Fix filesystem races in `ModuleManager` (PR #131354)

2025-03-14 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/131354 The `ModuleManager` uses `FileEntry` objects to uniquely identify module files. This requires first consulting the `FileManager` (and therefore the file system) when loading PCM files. This is problematic,

[clang] [clang][modules][deps] Add mutex as an alternative to file lock (PR #129751)

2025-03-18 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/129751 >From 7dadb10f4e63e419a230270b5f26a145d7015ae7 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 12 Mar 2025 10:20:16 -0700 Subject: [PATCH 1/2] [clang][deps] Implement efficient in-process `ModuleCach

[clang] [clang][modules] Name the module map files on PCM file conflict (PR #134475)

2025-04-04 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/134475 With implicitly-built modules, seeing something like: ``` fatal error: module 'X' is defined in both '/HASH1/X-HASH2.pcm' and '/HASH1/X-HASH3.pcm' ``` is super confusing and not actionable, because the modu

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-04-05 Thread Jan Svoboda via cfe-commits
@@ -2128,9 +2245,16 @@ bool ModuleMap::loadModuleMapFile(FileEntryRef File, bool IsSystem, // If the module map file wasn't already entered, do so now. if (ID.isInvalid()) { -auto FileCharacter = -IsSystem ? SrcMgr::C_System_ModuleMap : SrcMgr::C_User_ModuleMa

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-04-05 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > > This now makes much more sense after the renames from the prep-commit. > > There are still some naming inconsistencies, though. For example > > `ModuleMap::loadModuleMapFile()` both **parses** and loads a module map > > file, but `ModuleMap::findOrLoadModule()` expects

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-03-25 Thread Jan Svoboda via cfe-commits
@@ -5834,9 +5834,13 @@ bool ASTReader::readASTFileControlBlock( break; case INPUT_FILE: bool Overridden = static_cast(Record[3]); + size_t FilenameLen = ModuleDir.size() + Record[7] + 1; auto Filename = ResolveImportedPath(PathBuf

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-03-25 Thread Jan Svoboda via cfe-commits
@@ -5834,9 +5834,13 @@ bool ASTReader::readASTFileControlBlock( break; case INPUT_FILE: bool Overridden = static_cast(Record[3]); + size_t FilenameLen = ModuleDir.size() + Record[7] + 1; auto Filename = ResolveImportedPath(PathBuf

[clang] [clang] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-03-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/132984 This PR makes it so that `CompilerInvocation` is the sole owner of the `HeaderSearchOptions` instance. >From b325e5553bafa3b83e3383cd38487f42eecce91b Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue,

[clang] [clang] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-03-25 Thread Jan Svoboda via cfe-commits
@@ -269,9 +269,6 @@ class CompilerInvocation : public CompilerInvocationBase { /// @{ using CompilerInvocationBase::LangOpts; using CompilerInvocationBase::TargetOpts; - std::shared_ptr getHeaderSearchOptsPtr() { -return HSOpts; - } jansvoboda11 wro

[clang] [clang][DepScan] Allow ModuleDep to be const (PR #132968)

2025-03-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. https://github.com/llvm/llvm-project/pull/132968 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Consistently use "load" to refer to populating clang::ModuleMap (PR #132970)

2025-03-25 Thread Jan Svoboda via cfe-commits
@@ -2136,20 +2136,20 @@ bool ModuleMap::parseModuleMapFile(FileEntryRef File, bool IsSystem, assert(Target && "Missing target information"); std::optional Buffer = SourceMgr.getBufferOrNone(ID); if (!Buffer) -return ParsedModuleMap[File] = true; +return LoadedMod

[clang] [clang-tools-extra] [clang] Consistently use "load" to refer to populating clang::ModuleMap (PR #132970)

2025-03-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 edited https://github.com/llvm/llvm-project/pull/132970 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Consistently use "load" to refer to populating clang::ModuleMap (PR #132970)

2025-03-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. Nice clarification, thanks! https://github.com/llvm/llvm-project/pull/132970 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Consistently use "load" to refer to populating clang::ModuleMap (PR #132970)

2025-03-25 Thread Jan Svoboda via cfe-commits
@@ -2136,20 +2136,20 @@ bool ModuleMap::parseModuleMapFile(FileEntryRef File, bool IsSystem, assert(Target && "Missing target information"); std::optional Buffer = SourceMgr.getBufferOrNone(ID); if (!Buffer) -return ParsedModuleMap[File] = true; +return LoadedMod

[clang] [clang-tools-extra] [clang][lex] Store non-owning options ref in `HeaderSearch` (PR #132780)

2025-03-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/132780 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-03-26 Thread Jan Svoboda via cfe-commits
@@ -373,10 +373,10 @@ Module *HeaderSearch::lookupModule(StringRef ModuleName, StringRef SearchName, SmallString<128> NestedModuleMapDirName; NestedModuleMapDirName = Dir.getDirRef()->getName(); llvm::sys::path::append(NestedModuleMapDirName, ModuleName); -if (

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-03-26 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 commented: This now makes much more sense after the renames from the prep-commit. There are still some naming inconsistencies, though. For example `ModuleMap::loadModuleMapFile()` both **parses** and loads a module map file, but `ModuleMap::findOrLoadModule()` e

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-03-26 Thread Jan Svoboda via cfe-commits
@@ -5834,9 +5834,13 @@ bool ASTReader::readASTFileControlBlock( break; case INPUT_FILE: bool Overridden = static_cast(Record[3]); + size_t FilenameLen = ModuleDir.size() + Record[7] + 1; auto Filename = ResolveImportedPath(PathBuf

[clang] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-03-26 Thread Jan Svoboda via cfe-commits
@@ -359,11 +359,11 @@ Module *HeaderSearch::lookupModule(StringRef ModuleName, StringRef SearchName, // checked DirectoryEntryRef NormalDir = *Dir.getDirRef(); // Search for a module map file in this directory. -if (loadModuleMapFile(NormalDir, IsSystem, -

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-03-27 Thread Jan Svoboda via cfe-commits
@@ -5834,13 +5847,27 @@ bool ASTReader::readASTFileControlBlock( break; case INPUT_FILE: bool Overridden = static_cast(Record[3]); - const size_t FilenameAsRequestedLength = Record[7] + 1; - auto ResolvedFilenameAsRequested = Resolv

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-04-08 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. https://github.com/llvm/llvm-project/pull/132237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-04-08 Thread Jan Svoboda via cfe-commits
@@ -2616,6 +2616,18 @@ bool ASTReader::shouldDisableValidationForFile( return false; } +namespace { + +std::pair +getUnresolvedInputFilenames(const ASTReader::RecordData &Record, jansvoboda11 wrote: Nit: Per [LLVM Coding Standards](https://llvm.org/docs/Co

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-04-08 Thread Jan Svoboda via cfe-commits
@@ -90,63 +90,132 @@ static bool checkHeaderSearchPaths(const HeaderSearchOptions &HSOpts, using PrebuiltModuleFilesT = decltype(HeaderSearchOptions::PrebuiltModuleFiles); -/// A listener that collects the imported modules and optionally the input -/// files. +/// A listene

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-04-08 Thread Jan Svoboda via cfe-commits
@@ -237,6 +237,17 @@ class ASTReaderListener { return true; } + /// Overloaded member function of \c visitInputFile that should + /// be defined when the input file contains both the virtual and external + /// paths, for example when deserializing input files from AST

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-04-08 Thread Jan Svoboda via cfe-commits
@@ -90,63 +90,132 @@ static bool checkHeaderSearchPaths(const HeaderSearchOptions &HSOpts, using PrebuiltModuleFilesT = decltype(HeaderSearchOptions::PrebuiltModuleFiles); -/// A listener that collects the imported modules and optionally the input -/// files. +/// A listene

[clang] [clang][index] Handle undefined function-like macros in single file parse mode (PR #135054)

2025-04-09 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/135054 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][index] Handle undefined function-like macros in single file parse mode (PR #135054)

2025-04-09 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/135054 The single file parse mode is supposed to enter both branches of an `#if` directive whenever the condition contains undefined identifiers. This patch adds support for undefined function-like macros, where

[clang] [clang][index] Skip over `#include UNDEF_IDENT` in single-file-parse mode (PR #135218)

2025-04-10 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/135218 In the 'single-file-parse' mode, seeing `#include UNDEFINED_IDENTIFIER` should not be treated as an error. The identifier might be defined in a header that we decided to skip, resulting in a nonsensical di

[clang] [clang][modules] Dependency Scanning: Temporarily Turn Off Negative Directory Caching (PR #134698)

2025-04-10 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: The change itself makes sense to me. But AFAIK this is a workaround for misconfigured Xcode projects, so I suggest we carry this patch downstream (and possibly only in the current release branch while working to fix the build system or projects in the next release). https:

[clang] [clang][deps] Do check for relocated modules (PR #133827)

2025-03-31 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/133827 This essentially reverts commit 227f71995804 (https://reviews.llvm.org/D150320). The original change to disable checking for relocated modules was built on the assumption that the file system is immutable

[clang] [clang-tools-extra] [clang] Do not share ownership of `PreprocessorOptions` (PR #133467)

2025-03-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/133467 This PR makes it so that `CompilerInvocation` is the sole owner of the `PreprocessorOptions` instance. >From 9348867cfb2d243df7e91f20d6e635217d9af4e1 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri,

[clang] [clang] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-03-28 Thread Jan Svoboda via cfe-commits
@@ -116,7 +116,7 @@ class ASTUnit { std::shared_ptr PP; IntrusiveRefCntPtr Ctx; std::shared_ptr TargetOpts; - std::shared_ptrHSOpts; + std::unique_ptr HSOpts; jansvoboda11 wrote: Not really, I just didn't want to change

[clang] [clang] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-03-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/132984 >From a8acd492ff63ffb4d06a90fd2dfe50c28bee30c2 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 28 Mar 2025 09:02:12 -0700 Subject: [PATCH] [clang] Do not share ownership of `HeaderSearchOptions` ---

[clang] [clang] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-03-28 Thread Jan Svoboda via cfe-commits
@@ -116,7 +116,7 @@ class ASTUnit { std::shared_ptr PP; IntrusiveRefCntPtr Ctx; std::shared_ptr TargetOpts; - std::shared_ptrHSOpts; + std::unique_ptr HSOpts; jansvoboda11 wrote: (And didn't want to pay the initializatio

[clang] [clang-tools-extra] [clang] Do not share ownership of `PreprocessorOptions` (PR #133467)

2025-03-28 Thread Jan Svoboda via cfe-commits
@@ -272,9 +272,6 @@ class CompilerInvocation : public CompilerInvocationBase { std::shared_ptr getHeaderSearchOptsPtr() { return HSOpts; } - std::shared_ptr getPreprocessorOptsPtr() { -return PPOpts; - } jansvoboda11 wrote: This was the primary g

[clang] [clang-tools-extra] [clang] Do not share ownership of `PreprocessorOptions` (PR #133467)

2025-03-28 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > Are you planning to do the same for LangOpts and HSOpts? What's the ultimate > goal here? Yes, I'd like to do this for all options. The immediate goal is for `CompilerInvocation` to be the only class responsible for managing lifetimes of the underlying `Options` objects.

[clang] [clang-tools-extra] [clang][modules] Introduce new `ModuleCache` interface (PR #131193)

2025-03-15 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/131193 >From 3ac8635ed7e647be49d3b5e59b4e5be0d19bc629 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 13 Mar 2025 10:31:39 -0700 Subject: [PATCH 1/2] [clang][modules] Introduce new `ModuleCache` interface -

[clang] [llvm] [Support] Remove output file checks from `LockFileManager` (PR #130395)

2025-03-15 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/130395 >From a9969c43be752ccaa70959fd4527a57dc2981881 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 6 Mar 2025 17:29:34 -0800 Subject: [PATCH 1/2] [Support] Remove output file checks from `LockFileManager

[clang] [clang-tools-extra] [clang][modules] Introduce new `ModuleCache` interface (PR #131193)

2025-03-14 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/131193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules][deps] Add mutex as an alternative to file lock (PR #129751)

2025-03-14 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/129751 >From 5aef4afc8ec98ea93459dfa0ac19fd972472e38a Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 12 Mar 2025 10:20:16 -0700 Subject: [PATCH] [clang][deps] Implement efficient in-process `ModuleCache` -

[clang] [clang][modules][deps] Add mutex as an alternative to file lock (PR #129751)

2025-03-15 Thread Jan Svoboda via cfe-commits
@@ -0,0 +1,84 @@ +//===--===// +// +// 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: Apac

[clang] [clang][modules][deps] Add mutex as an alternative to file lock (PR #129751)

2025-03-14 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/129751 >From 7dadb10f4e63e419a230270b5f26a145d7015ae7 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 12 Mar 2025 10:20:16 -0700 Subject: [PATCH] [clang][deps] Implement efficient in-process `ModuleCache` -

[clang] [clang][modules][deps] Add mutex as an alternative to file lock (PR #129751)

2025-03-14 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 deleted https://github.com/llvm/llvm-project/pull/129751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    8   9   10   11   12   13   14   15   16   >