[clang] [clang][scan-deps] Add option to disable caching stat failures (PR #144000)

2025-06-13 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. LGTM. I think I would slightly prefer for `DependencyScanningWorkerFilesystem` to accept the entire service instead of its members (for the same reasons we do that in the worker, action, etc.) https://github.com/llvm/llvm-project/pull

[clang] [Modules] Don't fail when an unused textual header is missing. (PR #138227)

2025-06-04 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > What's worse, it really depends on whether any `FileID` used by that file was > ever deserialized That reminds me of the issue @alexfh and I discussed here: * [[clang][modules] NFCI: Pragma diagnostic mappings: write/read FileID instead of SourceLocation](https://reviews.

[clang] [clang][modules] rename "AST" to precompiled in diagnostic messages NFCI (PR #142635)

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

[clang] [ASTWriter] Do not write ObjCCategories if empty. (PR #141841)

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

[clang] [clang] Rename diag notes that assumed precompiled dependencies are pch's, NFCI (PR #142161)

2025-05-30 Thread Jan Svoboda via cfe-commits
@@ -24,8 +24,9 @@ def err_fe_ast_file_modified : Error< DefaultFatal; def err_fe_pch_file_overridden : Error< "file '%0' from the precompiled header has been overridden">; -def note_pch_required_by : Note<"'%0' required by '%1'">; -def note_pch_rebuild_required : Note<"

[clang] [clang] Rename diag notes that assumed precompiled dependencies are pch's, NFCI (PR #142161)

2025-05-30 Thread Jan Svoboda via cfe-commits
@@ -24,8 +24,9 @@ def err_fe_ast_file_modified : Error< DefaultFatal; def err_fe_pch_file_overridden : Error< "file '%0' from the precompiled header has been overridden">; -def note_pch_required_by : Note<"'%0' required by '%1'">; -def note_pch_rebuild_required : Note<"

[clang] [clang-tools-extra] [lldb] [clang] Remove intrusive reference count from `DiagnosticOptions` (PR #139584)

2025-05-29 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Thanks for the concrete example! I think the key thing to realize is that the `DiagnosticsEngine` and `DiagnosticOptions` used for command-line parsing are typically throwaway and separate from those used for actual compilation. I suggest looking at how `cc1_main()` orchest

[clang] NFCI: [clang][deps] Simplify handling of main TU context hash (PR #141966)

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

[clang] NFCI: [clang][deps] Simplify handling of main TU context hash (PR #141966)

2025-05-29 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/141966 Instead of handling the context hash in a preprocessor callback on each file change, do it once at the end of the scan. >From 26d8a1828e201447fb3cba5ba4258a4b282a79cc Mon Sep 17 00:00:00 2001 From: Jan Svo

[clang] [ASTWriter] Do not write ObjCCategories if empty. (PR #141841)

2025-05-28 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: This change makes sense to me. I have two questions: 1. Can we add a test that checks that the block is omitted? (maybe via `llvm-bcanalyzer -dump`) 2. Can we make the `explicit-build.cpp` test more robust? (possibly by writing out import signatures) https://github.com/llvm

[clang] [clang-tools-extra] [clang] Fix LogDiagnosticPrinter.h and ClangTidyPlugin.cpp after 9e306ad4 (PR #141131)

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

[clang] [clang-tools-extra] [clang] Fix LogDiagnosticPrinter.h and ClangTidyPlugin.cpp after 9e306ad4 (PR #141131)

2025-05-22 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Thank you too! https://github.com/llvm/llvm-project/pull/141131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Fix LogDiagnosticPrinter.h and ClangTidyPlugin.cpp after 9e306ad4 (PR #141131)

2025-05-22 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > @jansvoboda11 With this PR, I still see: > > ``` > clang/lib/Frontend/LogDiagnosticPrinter.cpp:24:7: error: member initializer > 'DiagOpts' does not name a non-static data member or base class >24 | DiagOpts(DiagOpts) {} > | ^~ > ``` >

[clang] [clang-tools-extra] [clang] Fix LogDiagnosticPrinter.h and ClangTidyPlugin.cpp after 9e306ad4 (PR #141131)

2025-05-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/141131 >From b57f5b1adb7bb7bd70f8c442d0a0031fa0aeed2a Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 22 May 2025 13:22:18 -0700 Subject: [PATCH 1/2] [clang] Fix LogDiagnosticPrinter.h and ClangTidyPlugin.c

[clang] [clang-tools-extra] [lldb] [clang] Remove intrusive reference count from `DiagnosticOptions` (PR #139584)

2025-05-22 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Thanks, I'll fix those ASAP. https://github.com/llvm/llvm-project/pull/139584 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Fix LogDiagnosticPrinter.h and ClangTidyPlugin.cpp after 9e306ad4 (PR #141131)

2025-05-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/141131 None >From b57f5b1adb7bb7bd70f8c442d0a0031fa0aeed2a Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 22 May 2025 13:22:18 -0700 Subject: [PATCH] [clang] Fix LogDiagnosticPrinter.h and ClangTidyPlugin.

[clang] [clang-tools-extra] [lldb] [clang] Remove intrusive reference count from `DiagnosticOptions` (PR #139584)

2025-05-22 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Are those in the upstream repo? If so, where are they coming from? I have a sparse checkout, so it's possible I missed some non-Clang and non-LLDB usages of `DiagnosticOptions`. https://github.com/llvm/llvm-project/pull/139584 ___

[clang] [clang-tools-extra] [lldb] [clang] Remove intrusive reference count from `DiagnosticOptions` (PR #139584)

2025-05-22 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Reverted the revert, since the build now fails due to the forward-fixes not being reverted... https://github.com/llvm/llvm-project/pull/139584 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [clang-tools-extra] [lldb] [clang] Remove intrusive reference count from `DiagnosticOptions` (PR #139584)

2025-05-22 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > @jansvoboda11 I've revered your PR due buildbot failures above (and my local > build failures with the same error messages). I'm happy to try your revised > patch to see if it build cleanly. Thanks! I already forward-fixed both failures: d25f95fdbc5314f30618912e18f00ad4dd

[clang] [WIP][C++20][Modules] Lazily, but fully load 'HeaderFileInfo' table into memory. (PR #140867)

2025-05-21 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: FWIW I tried running this patch through my `clang-scan-deps` benchmark on an internal Apple project and saw 16% increase in instruction count. https://github.com/llvm/llvm-project/pull/140867 ___ cfe-commits mailing list cfe-commit

[clang] [clang][lex] Introduce new single-module-parse mode (PR #135813)

2025-05-20 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/135813 >From 5cab1328fd689783ac4117083e231e7f0a49c3db Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 9 Apr 2025 13:11:38 -0700 Subject: [PATCH] [clang][lex] Introduce new single-module-parse mode --- clan

[clang-tools-extra] 72b2219 - Revert "[clang][modules] Timestamp-less validation API (#139987)"

2025-05-19 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2025-05-19T12:57:54-07:00 New Revision: 72b2219b3e2319e29831e4e9b07c440444f3add6 URL: https://github.com/llvm/llvm-project/commit/72b2219b3e2319e29831e4e9b07c440444f3add6 DIFF: https://github.com/llvm/llvm-project/commit/72b2219b3e2319e29831e4e9b07c440444f3add6.diff L

[clang] 175f8a4 - [clang] Attempt to fix "test/Modules/fmodules-validate-once-per-build-session.c"

2025-05-19 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2025-05-19T12:11:11-07:00 New Revision: 175f8a444b296ba956505a5760805f05a175111b URL: https://github.com/llvm/llvm-project/commit/175f8a444b296ba956505a5760805f05a175111b DIFF: https://github.com/llvm/llvm-project/commit/175f8a444b296ba956505a5760805f05a175111b.diff L

[clang-tools-extra] 7a24238 - Reland "[clang][modules] Timestamp-less validation API (#139987)"

2025-05-19 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2025-05-19T10:40:55-07:00 New Revision: 7a242387c950c7060143da6da0e6fb91f36bb458 URL: https://github.com/llvm/llvm-project/commit/7a242387c950c7060143da6da0e6fb91f36bb458 DIFF: https://github.com/llvm/llvm-project/commit/7a242387c950c7060143da6da0e6fb91f36bb458.diff L

[clang] [clang-tools-extra] [clang][modules] Timestamp-less validation API (PR #138983)

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

[clang] [clang-tools-extra] [lldb] [clang] Remove intrusive reference count from `DiagnosticOptions` (PR #139584)

2025-05-14 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/139584 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,s

[clang] [clang-tools-extra] [lldb] [clang] Remove intrusive reference count from `DiagnosticOptions` (PR #139584)

2025-05-14 Thread Jan Svoboda via cfe-commits
@@ -2032,6 +2032,7 @@ class SourceManagerForFile { // as they are created in `createSourceManagerForFile` so that they can be // deleted in the reverse order as they are created. std::unique_ptr FileMgr; + std::unique_ptr DiagOpts; jansvoboda11 wrote: I

[clang] [clang-tools-extra] [lldb] [clang] Remove intrusive reference count from `DiagnosticOptions` (PR #139584)

2025-05-14 Thread Jan Svoboda via cfe-commits
@@ -837,6 +838,7 @@ class ASTUnit { static std::unique_ptr LoadFromCommandLine( const char **ArgBegin, const char **ArgEnd, std::shared_ptr PCHContainerOps, + std::shared_ptr DiagOpts, jansvoboda11 wrote: Explained above. https://github.com

[clang] [clang-tools-extra] [lldb] [clang] Remove intrusive reference count from `DiagnosticOptions` (PR #139584)

2025-05-14 Thread Jan Svoboda via cfe-commits
@@ -107,6 +107,7 @@ class ASTUnit { private: std::unique_ptr LangOpts; + std::shared_ptr DiagOpts; jansvoboda11 wrote: I was hoping it could be, but the situation is a bit weird. The documentation for `ASTUnit::LoadFromCommandLine()` says the `Diagnostics

[clang] [clang][modules] Invalidate module cache when SDKSettings.json changes (PR #139751)

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

[clang] [clang][modules] Invalidate module cache when SDKSettings.json changes (PR #139751)

2025-05-13 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/139751 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,s

[clang] [clang][modules] Invalidate module cache when SDKSettings.json changes (PR #139751)

2025-05-13 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/139751 This PR adds the `%sdk/SDKSettings.json` file to the PCM input file table, so that the PCM gets invalidated when the file changes. This is necessary for availability checks to work correctly.

[clang] [clang-tools-extra] [clang][modules] Timestamp-less validation API (PR #138983)

2025-05-12 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/138983 >From 5ae3871b981d22583ce1b168cbbe3429317d89eb Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 24 Apr 2025 15:10:23 -0700 Subject: [PATCH] [clang][modules] Timestamp-less validation API --- clang-to

[clang] [clang-tools-extra] [lldb] [clang] Remove intrusive reference count from `DiagnosticOptions` (PR #139584)

2025-05-12 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/139584 The `DiagnosticOptions` class is currently intrusively reference-counted, which makes reasoning about its lifetime very difficult in some cases. For example, `CompilerInvocation` owns the `DiagnosticOption

[clang-tools-extra] [modularize] Use std::tie to implement operator< (NFC) (PR #139410)

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

[clang] [clang][modules][deps] Implicit modules are out of date when their explicit imports are (PR #138920)

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

[clang] [clang][modules][deps] Implicit modules are out of date when their explicit imports are (PR #138920)

2025-05-09 Thread Jan Svoboda via cfe-commits
@@ -0,0 +1,178 @@ +// Test that modifications to a common header (imported from both a PCH and a TU) +// cause rebuilds of dependent modules imported from the TU on incremental build. + +// RUN: rm -rf %t +// RUN: split-file %s %t + +//--- module.modulemap +module mod_common { h

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

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

[clang] [clang][modules] Allow not forcing validation of user headers (PR #139091)

2025-05-09 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/139091 ___ 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] Timestamp-less validation API (PR #138983)

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

[clang] [clang][modules] Allow not forcing validation of user headers (PR #139091)

2025-05-08 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/139091 Force-validation of user headers was implemented in acb803e8 to deal with files changing during build. The dependency scanner guarantees an immutable file system during single build session, so the validat

[clang] [clang][modules][deps] Implicit modules are out of date when their explicit imports are (PR #138920)

2025-05-07 Thread Jan Svoboda via cfe-commits
@@ -0,0 +1,77 @@ +// Test that modifications to a common header (imported from both a PCH and a TU) +// cause rebuilds of dependent modules imported from the TU on incremental build. + +// RUN: rm -rf %t +// RUN: split-file %s %t + +//--- module.modulemap +module mod_common { he

[clang] [clang][modules][deps] Implicit modules are out of date when their explicit imports are (PR #138920)

2025-05-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/138920 >From 306a9ceab9aa77ccb2752e847339c5a67e672549 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 7 May 2025 10:10:47 -0700 Subject: [PATCH 1/2] [clang][modules][deps] Rebuild implicit modules when thei

[clang] [clang][modules][deps] Optimize in-process timestamping of PCMs (PR #137363)

2025-05-07 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: (Just adding a note here for my records that this speeds up from-scratch scans by 1.4% and incremental _null_ scans by 67% on my benchmark.) https://github.com/llvm/llvm-project/pull/137363 ___ cfe-commits mailing list cfe-commits@

[clang] [clang-tools-extra] [clang][modules] Timestamp-less validation API (PR #138983)

2025-05-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/138983 Timestamps are an implementation detail of the cross-process module cache implementation. This PR hide it from the `ModuleCache` API, which simplifies the in-process implementation. >From 8d594dd6ffdf2601

[clang] [clang][Unit Test] Updating Negative Stat Caching Diagnostic Unit Test (PR #138955)

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

[clang] [clang][modules][deps] Optimize in-process timestamping of PCMs (PR #137363)

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

[clang] [clang][modules][deps] Implicit modules are out of date when their explicit imports are (PR #138920)

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

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

2025-05-06 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Test change LGTM, I was probably trying to get to a minimal test-case and ended up with something that was relying on implementation details. https://github.com/llvm/llvm-project/pull/132853 ___ cfe-commits mailing list cfe-commits

[clang] [clang] Provide to `PPCallbacks` full expression range even in single file parse mode. (PR #138358)

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

[clang] [clang][modules][deps] Optimize in-process timestamping of PCMs (PR #137363)

2025-05-01 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/137363 >From f5b5bc95209c2c44c30481754870d319df20f78f Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 24 Apr 2025 14:35:59 -0700 Subject: [PATCH 1/5] [clang][deps] Optimize in-process timestamping of PCMs -

[clang] [clang-tools-extra] [lldb] [clang][frontend] Require invocation to construct `CompilerInstance` (PR #137668)

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

[clang] [clang-tools-extra] [lldb] [clang][frontend] Require invocation to construct `CompilerInstance` (PR #137668)

2025-04-29 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/137668 >From 692779413664a17287a1f34d4e3225ae8bc96ae0 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Mon, 21 Apr 2025 11:55:43 -0700 Subject: [PATCH 1/2] [clang][frontend] Require invocation for `CompilerInstan

[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)

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

[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)

2025-04-29 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/137675 >From 14469a8726fc1d038f41c7e3e29a84ec8f52d013 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 22 Aug 2024 08:45:08 -0700 Subject: [PATCH 1/2] [clang] Hide the `LangOptions` pointer from `CompilerInv

[clang] [clang] Enable making the `CompilerInstance` module dependency collector thread-safe (PR #137227)

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

[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)

2025-04-29 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > Also looks like [this > assert](https://github.com/llvm/llvm-project/blob/14469a8726fc1d038f41c7e3e29a84ec8f52d013/clang/include/clang/Frontend/ASTUnit.h#L472) > doesn't serve its value anymore > > ```c++ > const LangOptions &getLangOpts() const { > assert(LangOpts

[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)

2025-04-29 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > > The `unique_ptr` in `ASTUnit` always stores a **copy** of the `shared_ptr` > > in `CompilerInvocation`. > > And we need `unique_ptr` in `ASTUnit` instead of a direct value so we can > change LangOpts in `ASTUnit::Parse`? Not really, using `LangOptions` directly instead

[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)

2025-04-29 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: The `unique_ptr` in `ASTUnit` always stores a **copy** of the `shared_ptr` in `CompilerInvocation`. https://github.com/llvm/llvm-project/pull/137675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [clang][modules][deps] Optimize in-process timestamping of PCMs (PR #137363)

2025-04-29 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/137363 >From 5b72c421030761d432af4e7d1d87120192ffa475 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 24 Apr 2025 14:35:59 -0700 Subject: [PATCH 1/5] [clang][deps] Optimize in-process timestamping of PCMs -

[clang] [clang][modules][deps] Optimize in-process timestamping of PCMs (PR #137363)

2025-04-29 Thread Jan Svoboda via cfe-commits
@@ -59,19 +60,46 @@ class InProcessModuleCache : public ModuleCache { InMemoryModuleCache InMemory; public: - InProcessModuleCache(ModuleCacheMutexes &Mutexes) : Mutexes(Mutexes) {} + InProcessModuleCache(ModuleCacheEntries &Entries) : Entries(Entries) {} void prepare

[clang] [clang] Make the `AnalyzerOptions` reference count non-intrusive (PR #137680)

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

[clang] [clang] Make the `AnalyzerOptions` reference count non-intrusive (PR #137680)

2025-04-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/137680 This PR makes `CompilerInvocation` the sole owner of the `AnalyzerOptions` instance. Clients can no longer become co-owners by doing something like this: ```c++ void shareOwnership(CompilerInvocation &CI)

[clang] [clang] Hide the `LangOptions` pointer from `CompilerInvocation` (PR #137675)

2025-04-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/137675 This PR makes `CompilerInvocation` the sole owner of the `LangOptions` instance. >From 14469a8726fc1d038f41c7e3e29a84ec8f52d013 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 22 Aug 2024 08:45:08 -0

[clang] [clang-tools-extra] [lldb] [clang][frontend] Require invocation to construct `CompilerInstance` (PR #137668)

2025-04-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/137668 This PR makes it so that `CompilerInvocation` needs to be provided to `CompilerInstance` on construction. There are a couple of benefits in my view: * Making it impossible to mis-use some `CompilerInstance`

[clang] [clang-tools-extra] [lldb] [clang] Hide the `TargetOptions` pointer from `CompilerInvocation` (PR #106271)

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

[clang] [clang-tools-extra] [lldb] [clang] Hide the `TargetOptions` pointer from `CompilerInvocation` (PR #106271)

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

[clang] [clang-tools-extra] [lldb] [clang] Hide the `TargetOptions` pointer from `CompilerInvocation` (PR #106271)

2025-04-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/106271 >From 4431265f6be2b989b63e4562fa8def4448d336ab Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 27 Aug 2024 09:34:01 -0700 Subject: [PATCH 1/7] [clang] `TargetInfo` does not own `TargetOptions` --- c

[clang] [clang][modules][deps] Optimize in-process timestamping of PCMs (PR #137363)

2025-04-25 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: CC @artemcm https://github.com/llvm/llvm-project/pull/137363 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules][deps] Optimize in-process timestamping of PCMs (PR #137363)

2025-04-25 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/137363 In the past, timestamps used for `-fmodules-validate-once-per-build-session` were found to be a source of contention in the dependency scanner ([D149802](https://reviews.llvm.org/D149802), https://github

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

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

[clang] [clang] Enable making the `CompilerInstance` module dependency collector thread-safe (PR #137227)

2025-04-24 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/137227 The same principle as #135473, #135737, #136178, #136601 & #137059. >From 30fb74c3ff1197a6e1d7cdc8ff52fa2d2c0d9c33 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 24 Apr 2025 11:26:17 -0700 Subject:

[clang] [clang] Enable making the module build stack thread-safe (PR #137059)

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

[clang] [clang][Modules] Diagnose mismatching pcm dependencies in explicit buiilds (PR #137068)

2025-04-24 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. LGTM, but I'd try to align the spelling of the diagnostic (`"-Wlazy-pcm-mismatch"`) with how we talk about the `-fmodule-file=X=X.pcm` option (`"mapping of module name to precompiled module file"`). Maybe `"-Wmodule-file-mapping-misma

[clang] [Clang] Fix crash when -header-include-filtering is not specified (PR #136232)

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

[clang] [clang][Modules] Diagnose mismatching pcm dependencies in explicit buiilds (PR #137068)

2025-04-23 Thread Jan Svoboda via cfe-commits
@@ -3311,11 +3312,22 @@ ASTReader::ReadControlBlock(ModuleFile &F, SignatureBytes.end()); Blob = Blob.substr(ASTFileSignature::size); +// Use BaseDirectoryAsWritten to ensure we use the same path in the +

[clang] [clang] Adding an API to create a `CXStringSet` from a Vector of `StringRef`s (PR #136773)

2025-04-23 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. LGTM, thanks! I left a couple of comments for your consideration, but don't feel obligated to incorporate them. https://github.com/llvm/llvm-project/pull/136773 ___ cfe-commits mailing list c

[clang] [clang] Enable making the module build stack thread-safe (PR #137059)

2025-04-23 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/137059 This PR makes another piece of the `CompilerInstance::cloneForModuleCompile()` result thread-safe: the module build stack. This data structure is used to detect cyclic dependencies between modules. The pro

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

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

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

2025-04-23 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/132984 >From 8599450e27f0d866db8785f1840372583fc545a2 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-04-23 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: CC @AaronBallman as a last resort. The reason for `CompilerInvocation` not sharing ownership of its sub-objects is given here: https://github.com/llvm/llvm-project/pull/133467#issuecomment-2762065443 https://github.com/llvm/llvm-project/pull/132984 _

[clang] [clang] Adding an API to create a `CXStringSet` from a Vector of `StringRef`s (PR #136773)

2025-04-23 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: How about `clang/unittests/libclang/LibclangTest.cpp`? https://github.com/llvm/llvm-project/pull/136773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Adding an API to create a `CXStringSet` from a Vector of `StringRef`s (PR #136773)

2025-04-23 Thread Jan Svoboda via cfe-commits
@@ -107,15 +107,28 @@ CXString createCXString(CXStringBuf *buf) { return Str; } -CXStringSet *createSet(const std::vector &Strings) { +template +static CXStringSet *createSetImpl(ArrayRef Strings) { CXStringSet *Set = new CXStringSet; Set->Count = Strings.size(); S

[clang] [clang] Adding an API to create a `CXStringSet` from a Vector of `StringRef`s (PR #136773)

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

[clang] [clang] Adding an API to create a `CXStringSet` from a Vector of `StringRef`s (PR #136773)

2025-04-23 Thread Jan Svoboda via cfe-commits
@@ -107,15 +107,28 @@ CXString createCXString(CXStringBuf *buf) { return Str; } -CXStringSet *createSet(const std::vector &Strings) { +template +static CXStringSet *createSetImpl(ArrayRef Strings) { jansvoboda11 wrote: Nit: If you switched the order of tem

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-22 Thread Jan Svoboda via cfe-commits
@@ -3349,10 +3351,29 @@ ASTReader::ReadControlBlock(ModuleFile &F, .getModuleCache() .getInMemoryModuleCache() .isPCMFinal(F.FileName); - if (isDiagnosedResult

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-22 Thread Jan Svoboda via cfe-commits
@@ -3349,10 +3351,29 @@ ASTReader::ReadControlBlock(ModuleFile &F, .getModuleCache() .getInMemoryModuleCache() .isPCMFinal(F.FileName); - if (isDiagnosedResult

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-22 Thread Jan Svoboda via cfe-commits
@@ -3349,10 +3351,29 @@ ASTReader::ReadControlBlock(ModuleFile &F, .getModuleCache() .getInMemoryModuleCache() .isPCMFinal(F.FileName); - if (isDiagnosedResult

[clang] [clang] Enable making `CompilerInstance` diagnostics thread-safe (PR #136601)

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

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-22 Thread Jan Svoboda via cfe-commits
@@ -3349,10 +3351,29 @@ ASTReader::ReadControlBlock(ModuleFile &F, .getModuleCache() .getInMemoryModuleCache() .isPCMFinal(F.FileName); - if (isDiagnosedResult

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-22 Thread Jan Svoboda via cfe-commits
@@ -3349,10 +3351,29 @@ ASTReader::ReadControlBlock(ModuleFile &F, .getModuleCache() .getInMemoryModuleCache() .isPCMFinal(F.FileName); - if (isDiagnosedResult

[clang] [clang] Adding an API to create a `CXStringSet` from a Vector of `StringRef`s (PR #136773)

2025-04-22 Thread Jan Svoboda via cfe-commits
@@ -116,6 +117,13 @@ CXStringSet *createSet(const std::vector &Strings) { return Set; } +CXStringSet *createSet(const std::vector &Strings) { + return createSetImpl(Strings); +} + +CXStringSet *createSet(const std::vector &Strings) { + return createSetImpl(Strings); -

[clang] [clang][deps] Make dependency directives getter thread-safe (PR #136178)

2025-04-22 Thread Jan Svoboda via cfe-commits
@@ -92,16 +92,10 @@ bool Preprocessor::EnterSourceFile(FileID FID, ConstSearchDirIterator CurDir, } Lexer *TheLexer = new Lexer(FID, *InputFile, *this, IsFirstIncludeOfFile); - if (getPreprocessorOpts().DependencyDirectivesForFile && - FID != PredefinesFileID) { -

[clang] [clang][deps] Make dependency directives getter thread-safe (PR #136178)

2025-04-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/136178 >From 51449e05b19f3b0f237305159ae150bc92588fd9 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 11 Apr 2025 14:11:36 -0700 Subject: [PATCH 1/3] [clang][deps] Make dependency directives getter thread-s

[clang] [clang] Enable making `CompilerInstance` diagnostics thread-safe (PR #136601)

2025-04-22 Thread Jan Svoboda via cfe-commits
@@ -861,9 +864,13 @@ class CompilerInstance : public ModuleLoader { /// /// Explicitly-specified \c VFS takes precedence over the VFS of this instance /// when creating the clone and also prevents \c FileManager sharing. - std::unique_ptr cloneForModuleCompile( - S

[clang] [clang][deps] Make dependency directives getter thread-safe (PR #136178)

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

[clang] [Clang] Fix crash when -header-include-filtering is not specified (PR #136232)

2025-04-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. Looks great, thank you! https://github.com/llvm/llvm-project/pull/136232 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash when building a module with CC_PRINT_HEADERS_FORMAT=json (PR #136227)

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

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Jan Svoboda via cfe-commits
@@ -3349,9 +3351,14 @@ ASTReader::ReadControlBlock(ModuleFile &F, .getModuleCache() .getInMemoryModuleCache() .isPCMFinal(F.FileName); - if (isDiagnosedResult(

[clang] [clang][modules] Minor improvements to diagnosing `out of date` errors (PR #136612)

2025-04-21 Thread Jan Svoboda via cfe-commits
@@ -3349,9 +3351,14 @@ ASTReader::ReadControlBlock(ModuleFile &F, .getModuleCache() .getInMemoryModuleCache() .isPCMFinal(F.FileName); - if (isDiagnosedResult(

  1   2   3   4   5   6   7   8   9   10   >