[clang] [clang][modules] Allow module map files with textual headers to be non-affecting (PR #89441)

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

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

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

[clang] [clang][modules] Only avoid pruning module maps when asked to (PR #89428)

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

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-19 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89441 >From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 19 Apr 2024 12:13:06 -0700 Subject: [PATCH] [clang][modules] Allow module map files with textual header b

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

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

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-19 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Hmm, this will probably only work if you compile `A` into a PCM and then pass it to `B`. This is not how "Modules/preprocess-decluse.cpp" is set up. https://github.com/llvm/llvm-project/pull/89441 ___ cfe-commits mailing list cfe-c

[clang] [clang][modules] HeaderSearch::MarkFileModuleHeader creates extra HeaderFileInfo, breaks PCM reuse (PR #89005)

2024-04-19 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Just so you're aware, it's possible that https://github.com/llvm/llvm-project/pull/87848 introduced some unexpected behavior change. It would be good to check if your issues are caused just by one patch in isolation or by a combination of more patches that landed recently.

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

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

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-19 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: I updated the description of this PR, hopefully it makes more sense now. I still need to investigate what goes wrong in "Modules/preprocess-decluse.cpp". It seems that it assumes `%t/b.pcm` embeds the information from "a.modulemap". https://github.com/llvm/llvm-project/pull

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-19 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > Is this a pre-existing issue, or did my patch change to make "each textual > header gets a `HFI`"? I'm not sure yet, I think we'll need to investigate [Sam's reproducer](https://github.com/llvm/llvm-project/pull/89005#issuecomment-2067300965) and consider [Richard's com

[clang] [libclang] Compute the right spelling location (PR #72400)

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

[clang] [clang][modules] Stop eagerly reading files with diagnostic pragmas (PR #87442)

2024-04-22 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: @alexfh Can you check it doesn't boil down to the same thing as the issue you reported in https://reviews.llvm.org/D137213? https://github.com/llvm/llvm-project/pull/87442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [Clang] Diagnose apply AST consume actions on LLVM IR (PR #88602)

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

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89441 >From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 19 Apr 2024 12:13:06 -0700 Subject: [PATCH 1/2] [clang][modules] Allow module map files with textual head

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-22 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: @sam-mccall That makes sense. I think one option we have here is to consider all module maps describing a textual header that got included as affecting. I'm concerned that a long chain of textual header includes might again be problematic. For this particular test, we only

[clang] [clang][modules] Stop eagerly reading files with diagnostic pragmas (PR #87442)

2024-04-22 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: No worries, happy to get to the bottom of it. https://github.com/llvm/llvm-project/pull/87442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules][Diagnostic] Don't claim a METADATA mismatch is always in PCH file. (PR #101280)

2024-07-31 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. Doing the lord's work 🙏 https://github.com/llvm/llvm-project/pull/101280 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Make serialized diagnostics more reliable (PR #100681)

2024-07-31 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Could we simplify this even further by removing `DiagnosticConsumer::finish()` entirely, moving the code in `SDiagsWriter::finish()` to `SDiagsWriter::~SDiagsWriter()` and ensuring the **destructor** gets called even with `-disable-free`? Also, can you please create and li

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

2024-07-15 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] [lldb] [clang] Split ObjectFilePCHContainerReader from ObjectFilePCHContainerWriter (PR #99599)

2024-07-19 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. LGTM sans the missing newline at the end of file and file headers not aligned to 80 columns. https://github.com/llvm/llvm-project/pull/99599 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [clang][modules] Only modulemaps of included textual headers are affecting (PR #89729)

2024-04-23 Thread Jan Svoboda via cfe-commits
@@ -1441,6 +1441,10 @@ void HeaderSearch::MarkFileModuleHeader(FileEntryRef FE, HFI.isCompilingModuleHeader |= isCompilingModuleHeader; } +void HeaderSearch::EnteredTextualFile(FileEntryRef File) { + getFileInfo(File).isCompilingModuleHeader = true; jansvob

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-23 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89441 >From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 19 Apr 2024 12:13:06 -0700 Subject: [PATCH 1/3] [clang][modules] Allow module map files with textual head

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-23 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > I've sent a version of this as #89729, based on your first commit here. I left a comment there. > > I think one option we have here is to consider all module maps describing a > > textual header that got included as affecting. I'm concerned that a long > > chain of textu

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-23 Thread Jan Svoboda via cfe-commits
@@ -187,7 +187,8 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) { continue; const HeaderFileInfo *HFI = HS.getExistingLocalFileInfo(*File); -if (!HFI || (HFI->isModuleHeader && !HFI->isCompilingModuleHeader)) +if (!HFI || (HFI->isModul

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-23 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89441 >From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 19 Apr 2024 12:13:06 -0700 Subject: [PATCH 1/4] [clang][modules] Allow module map files with textual head

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-23 Thread Jan Svoboda via cfe-commits
@@ -0,0 +1,20 @@ +// This test checks that a module map with a textual header can be marked as jansvoboda11 wrote: This patch unfortunately doesn't pass that test (on line 44) due to [this](https://github.com/llvm/llvm-project/pull/89441/files#r1576422103): when

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-23 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89441 >From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 19 Apr 2024 12:13:06 -0700 Subject: [PATCH 1/5] [clang][modules] Allow module map files with textual head

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-23 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89441 >From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 19 Apr 2024 12:13:06 -0700 Subject: [PATCH 1/5] [clang][modules] Allow module map files with textual head

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-23 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89441 >From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 19 Apr 2024 12:13:06 -0700 Subject: [PATCH 1/6] [clang][modules] Allow module map files with textual head

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-23 Thread Jan Svoboda via cfe-commits
@@ -0,0 +1,20 @@ +// This test checks that a module map with a textual header can be marked as jansvoboda11 wrote: Should work with [b03c34f](https://github.com/llvm/llvm-project/pull/89441/commits/b03c34f99bd90398f0599b5703cbf82d8b881981). https://github.com/l

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-23 Thread Jan Svoboda via cfe-commits
@@ -0,0 +1,20 @@ +// This test checks that a module map with a textual header can be marked as jansvoboda11 wrote: (And thanks for the extended test case!) https://github.com/llvm/llvm-project/pull/89441 ___ cfe-commit

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-24 Thread Jan Svoboda via cfe-commits
@@ -1574,6 +1574,7 @@ bool HeaderSearch::ShouldEnterIncludeFile(Preprocessor &PP, } } + FileInfo.IsLocallyIncluded = true; jansvoboda11 wrote: I agree, I wanted to colocate this with call to `Preprocessor::markIncluded()`. If we find a better way of

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

2024-04-24 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89441 >From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 19 Apr 2024 12:13:06 -0700 Subject: [PATCH 1/8] [clang][modules] Allow module map files with textual head

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

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

[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

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

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-24 Thread Jan Svoboda via cfe-commits
@@ -2221,33 +,45 @@ class ASTReader return Sema::AlignPackInfo::getFromRawEncoding(Raw); } + using RawLocEncoding = SourceLocationEncoding::RawLocEncoding; + /// Read a source location from raw form and return it in its /// originating module file's source loc

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-24 Thread Jan Svoboda via cfe-commits
@@ -2220,33 +2221,40 @@ class ASTReader return Sema::AlignPackInfo::getFromRawEncoding(Raw); } + using RawLocEncoding = SourceLocationEncoding::RawLocEncoding; + /// Read a source location from raw form and return it in its /// originating module file's source loc

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-24 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. The changes LGTM, don't want to block this on my remaining nits. I believe @Bigcheese wanted to test test impact on PCM size on our side before this lands. https://github.com/llvm/llvm-project/pull/86912 __

[clang] [clang-scan-deps] Fix contention when updating `TrackingStatistic`s in hot code paths in `FileManager`. (PR #88427)

2024-04-24 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/88427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-scan-deps] Fix contention when updating `TrackingStatistic`s in hot code paths in `FileManager`. (PR #88427)

2024-04-24 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: (Out of interest, what machine are you seeing the contention with?) https://github.com/llvm/llvm-project/pull/88427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-24 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: This change makes sense to me, but I forget what's the purpose of the whole output path deducing code. Even for `clang-cl` command lines we should go through the driver and get a `CompilerInvocation` that will have the output file set (if the action does produce an output f

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-24 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > Maybe the issue is that the DependencyOptions we pass have no target set, > since the original command line doesn't have -MD (or something like that)? No, even then we should deduce the output path: https://github.com/llvm/llvm-project/blob/a45eb628779562fac72366f594fbcdc

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-24 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Hmm, that driver code is only executed if the dependency file was requested on the Clang command line, though. `clang-scan-deps` should be able to generate the dependency file even if the original command line doesn't have `-MD` and friends. That's why we call `deduceDepTar

[clang] [libclang] Compute the right spelling location (PR #72400)

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

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

2024-04-24 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/89992 None >From e16becb9357fd560a1c9c673389e6dbba02e024c Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 24 Apr 2024 11:12:28 -0700 Subject: [PATCH] [clang][modules] Allow including module maps to be non-

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

2024-04-24 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89992 >From 6e77e37977bbecc8053d12b4db3f790042b8f34d Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 24 Apr 2024 11:12:28 -0700 Subject: [PATCH] [clang][modules] Allow including module maps to be non-affect

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-25 Thread Jan Svoboda via cfe-commits
@@ -1069,7 +1069,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, // If user provided -o, that is the dependency target, except // when we are only generating a dependency file. - Arg *OutputOpt = Args.getLastArg(options::OPT_o);

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-25 Thread Jan Svoboda via cfe-commits
@@ -0,0 +1,36 @@ +// Check that the scanner can adjust arguments by reading .rsp files in advance. + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json jansvoboda11 wrote: You can now do this: `clang-sca

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

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

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-25 Thread Jan Svoboda via cfe-commits
@@ -0,0 +1,36 @@ +// Check that the scanner can adjust arguments by reading .rsp files in advance. + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json +// RUN: echo /Fo%t/tu.obj >> %t/args_nested.rsp jan

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-25 Thread Jan Svoboda via cfe-commits
@@ -792,10 +792,15 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { llvm::cl::PrintOptionValues(); + // Expand response files in advance, so that we can "see" all the arguments + // when adjusting below. + auto ResponseExpander = expandRes

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

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

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

2024-04-26 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89992 >From 6e77e37977bbecc8053d12b4db3f790042b8f34d Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 24 Apr 2024 11:12:28 -0700 Subject: [PATCH 1/2] [clang][modules] Allow including module maps to be non-af

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

2024-04-26 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89992 >From 8c2989ffe7b6e61b32facf831aa7eeabbf0001d2 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 24 Apr 2024 11:12:28 -0700 Subject: [PATCH 1/2] [clang][modules] Allow including module maps to be non-af

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

2024-04-26 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89992 >From 8c2989ffe7b6e61b32facf831aa7eeabbf0001d2 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 24 Apr 2024 11:12:28 -0700 Subject: [PATCH 1/3] [clang][modules] Allow including module maps to be non-af

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

2024-04-26 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/89992 >From 8c2989ffe7b6e61b32facf831aa7eeabbf0001d2 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 24 Apr 2024 11:12:28 -0700 Subject: [PATCH 1/3] [clang][modules] Allow including module maps to be non-af

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

2024-04-26 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 ready_for_review https://github.com/llvm/llvm-project/pull/89992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

2024-04-26 Thread Jan Svoboda via cfe-commits
@@ -249,9 +245,27 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) { for (const auto &KH : HS.findResolvedModulesForHeader(*File)) if (const Module *M = KH.getModule()) -CollectIncludingMapsFromAncestors(M); +CollectModuleMapsFor

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

2024-04-26 Thread Jan Svoboda via cfe-commits
@@ -249,9 +245,27 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) { for (const auto &KH : HS.findResolvedModulesForHeader(*File)) if (const Module *M = KH.getModule()) -CollectIncludingMapsFromAncestors(M); +CollectModuleMapsFor

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

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

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

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

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

2024-08-27 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/106271 This PR hides the reference-counter pointer that holds `TargetOptions` from the public API of `CompilerInvocation`. This gives `CompilerInvocation` an exclusive control over the lifetime of this member, wh

[clang] [clang-tools-extra] [clang] Hide the `DiagnosticOptions` pointer from `CompilerInvocation` (PR #106274)

2024-08-27 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/106274 This PR hides the reference-counter pointer that holds `DiagnosticOptions` from the public API of `CompilerInvocation`. This gives `CompilerInvocation` an exclusive control over the lifetime of this member

[clang] [clang-tools-extra] [clang] Hide the `DiagnosticOptions` pointer from `CompilerInvocation` (PR #106274)

2024-08-27 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: @kadircet Can you please check my assumption on the clangd part? The `.reset()` call was introduced in 27ade4b554774187d2c0afcf64cd16fa6d5f619d. https://github.com/llvm/llvm-project/pull/106274 ___ cfe-commits mailing list cfe-comm

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

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

[clang] [clang-tools-extra] [clang] Hide the `DiagnosticOptions` pointer from `CompilerInvocation` (PR #106274)

2024-08-29 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > yes turning diagnosticoptions to be a ThreadSafeRefCountedBase pointer should > ensure we have similar guarantees. so LG from clangd side Thanks for confirming! > I am not sure about implications on using thread-aware structs in core parts > of clang. so it might be wort

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

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

[clang] cc1: Report an error for multiple actions unless separated by -main-file-name (PR #91140)

2024-05-05 Thread Jan Svoboda via cfe-commits
@@ -2841,6 +2841,30 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, } Opts.ProgramAction = *ProgramAction; + +// Catch common mistakes when multiple actions are specified for cc1 (e.g. +// -S -emit-llvm means -emit-llvm while -emit-llvm

[clang] cc1: Report an error for multiple actions unless separated by -main-file-name (PR #91140)

2024-05-05 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: This sounds good in principle, but some tests are failing in CI, so this might need more refinement. https://github.com/llvm/llvm-project/pull/91140 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [clang][deps] Only bypass scanning VFS for the module cache (PR #88800)

2024-05-06 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: I don't think I'll have time to work on this PR in the short-term. https://github.com/llvm/llvm-project/pull/88800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-05-06 Thread Jan Svoboda via cfe-commits
@@ -0,0 +1,36 @@ +// Check that the scanner can adjust arguments by reading .rsp files in advance. + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json +// RUN: echo /Fo%t/tu.obj >> %t/args_nested.rsp jan

[clang] cc1: Report an error for multiple actions unless separated by -main-file-name (PR #91140)

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

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-05-24 Thread Jan Svoboda via cfe-commits
@@ -86,6 +86,8 @@ static bool DeprecatedDriverCommand; static ResourceDirRecipeKind ResourceDirRecipe; static bool Verbose; static bool PrintTiming; +static llvm::BumpPtrAllocator Alloc; +static llvm::StringSaver Saver{Alloc}; jansvoboda11 wrote: Why do these

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-05-24 Thread Jan Svoboda via cfe-commits
@@ -0,0 +1,36 @@ +// Check that the scanner can adjust arguments by reading .rsp files in advance. + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json jansvoboda11 wrote: Ok, that makes sense, thanks!

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-05-24 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 deleted https://github.com/llvm/llvm-project/pull/89950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-05-24 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/89950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [serialization] no transitive decl change (PR #92083)

2024-05-24 Thread Jan Svoboda via cfe-commits
@@ -124,6 +130,15 @@ class DeclIDBase { bool isInvalid() const { return ID == PREDEF_DECL_NULL_ID; } + unsigned getModuleFileIndex() const { return ID >> 32; } + + unsigned getLocalDeclIndex() const { +// Implement it directly instead of calling `llvm::maskTrailingOne

[clang] [serialization] no transitive decl change (PR #92083)

2024-05-24 Thread Jan Svoboda via cfe-commits
@@ -255,6 +255,12 @@ class DeclOffset { } }; +// The unaligned decl ID used in the Blobs of bistreams. +using unalighed_decl_id_t = jansvoboda11 wrote: I know this typo isn't introduced by your PR, but since your PR is touching it, please fix it in a prep

[clang] [serialization] no transitive decl change (PR #92083)

2024-05-24 Thread Jan Svoboda via cfe-commits
@@ -111,6 +109,28 @@ void *Decl::operator new(std::size_t Size, const ASTContext &Ctx, return ::operator new(Size + Extra, Ctx); } +GlobalDeclID Decl::getGlobalID() const { + if (!isFromASTFile()) +return GlobalDeclID(); + uint64_t ID = *((const uint64_t *)this - 1);

[clang] [serialization] no transitive decl change (PR #92083)

2024-05-24 Thread Jan Svoboda via cfe-commits
@@ -7802,20 +7800,31 @@ Decl *ASTReader::GetDecl(GlobalDeclID ID) { LocalDeclID ASTReader::mapGlobalIDToModuleFileGlobalID(ModuleFile &M, GlobalDeclID GlobalID) { - DeclID ID = GlobalID.get(); - if (ID < NUM_PREDEF_DECL_

[clang] [serialization] no transitive decl change (PR #92083)

2024-05-24 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 commented: This looks good conceptually, I left a couple of minor notes. https://github.com/llvm/llvm-project/pull/92083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [clang] Make serialized diagnostics more reliable (PR #100681)

2024-08-01 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > > Could we simplify this even further by removing > > `DiagnosticConsumer::finish()` entirely, moving the code in > > `SDiagsWriter::finish()` to `SDiagsWriter::~SDiagsWriter()` and ensuring > > the **destructor** gets called even with `-disable-free`? > > This is doable

[clang] [Modules][Diagnostic] Mention which AST file's options differ from the current TU options. (PR #101413)

2024-08-01 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > Sorry that the change is pretty big. But it is fairly mechanical. If you have > ideas about simplifying the review process, I'm open to that. Right now I'm > thinking if I should make the logical changes first, you review them, and I > commit clang-formatted change. I'd

[clang] [Modules][Diagnostic] Mention which AST file's options differ from the current TU options. (PR #101413)

2024-08-02 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. Makes sense, thank you! https://github.com/llvm/llvm-project/pull/101413 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Fix cyclic module dependencies in clang (PR #102348)

2024-08-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. LGTM, would be great to do the follow-up you suggest. https://github.com/llvm/llvm-project/pull/102348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang] Stop adjusting the module cache path (PR #102540)

2024-08-08 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/102540 This patch stops adjustments of the module cache path beyond what is done in `ParseHeaderSearchArgs` (making it absolute and removing dots). This enables more efficient implementation of the caching VFS in

[clang] [clang][deps] Only bypass scanning VFS for the module cache (PR #88800)

2024-08-08 Thread Jan Svoboda via cfe-commits
@@ -201,11 +201,8 @@ const CachedRealPath &DependencyScanningFilesystemSharedCache::CacheShard:: return *StoredRealPath; } -static bool shouldCacheStatFailures(StringRef Filename) { - StringRef Ext = llvm::sys::path::extension(Filename); - if (Ext.empty()) -return fal

[clang] [llvm] [llvm][support] Implement tracing virtual file system (PR #88326)

2024-08-08 Thread Jan Svoboda via cfe-commits
@@ -1125,6 +1125,54 @@ class YAMLVFSWriter { void write(llvm::raw_ostream &OS); }; +/// File system that tracks the number of calls to the underlying file system. +/// This is particularly useful when wrapped around \c RealFileSystem to add +/// lightweight tracking of expen

[clang] 8b21e07 - [clang] NFC: Remove unused `DirectoryLookup`

2022-01-18 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2022-01-18T16:02:18+01:00 New Revision: 8b21e074dbdf79062505f28b700bd4502acf3096 URL: https://github.com/llvm/llvm-project/commit/8b21e074dbdf79062505f28b700bd4502acf3096 DIFF: https://github.com/llvm/llvm-project/commit/8b21e074dbdf79062505f28b700bd4502acf3096.diff L

[clang-tools-extra] 105c913 - [clang][lex] NFC: Simplify calls to `LookupFile`

2022-01-18 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2022-01-18T16:02:18+01:00 New Revision: 105c913156e94163c937d812992fe3a56210998c URL: https://github.com/llvm/llvm-project/commit/105c913156e94163c937d812992fe3a56210998c DIFF: https://github.com/llvm/llvm-project/commit/105c913156e94163c937d812992fe3a56210998c.diff L

[clang-tools-extra] c6fb636 - [clangd][clang-tidy] Remove uses of `std::vector`

2022-01-18 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2022-01-18T17:59:40+01:00 New Revision: c6fb636667b879bfc8329d2c9ca5873871b46a7b URL: https://github.com/llvm/llvm-project/commit/c6fb636667b879bfc8329d2c9ca5873871b46a7b DIFF: https://github.com/llvm/llvm-project/commit/c6fb636667b879bfc8329d2c9ca5873871b46a7b.diff L

[clang] ced077e - [clang][deps] NFC: Simplify handling of cached FS errors

2022-01-21 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2022-01-21T13:04:25+01:00 New Revision: ced077e1ba52ec2937aab538e9b6fa5149f8c567 URL: https://github.com/llvm/llvm-project/commit/ced077e1ba52ec2937aab538e9b6fa5149f8c567 DIFF: https://github.com/llvm/llvm-project/commit/ced077e1ba52ec2937aab538e9b6fa5149f8c567.diff L

[clang] 5daeada - [clang][deps] Ensure filesystem cache consistency

2022-01-21 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2022-01-21T13:04:25+01:00 New Revision: 5daeada33051aa85777593d3f69eb29f26e7fb2f URL: https://github.com/llvm/llvm-project/commit/5daeada33051aa85777593d3f69eb29f26e7fb2f DIFF: https://github.com/llvm/llvm-project/commit/5daeada33051aa85777593d3f69eb29f26e7fb2f.diff L

[clang] 8cc2a13 - [clang][deps] Handle symlinks in minimizing FS

2022-01-21 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2022-01-21T13:04:25+01:00 New Revision: 8cc2a137270462bc191377dbab97c739583814dd URL: https://github.com/llvm/llvm-project/commit/8cc2a137270462bc191377dbab97c739583814dd DIFF: https://github.com/llvm/llvm-project/commit/8cc2a137270462bc191377dbab97c739583814dd.diff L

[clang-tools-extra] 622354a - [llvm][ADT] Implement `BitVector::{pop_, }back`

2022-01-21 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2022-01-21T14:50:53+01:00 New Revision: 622354a522073b0a048a88c957b161fb376a40eb URL: https://github.com/llvm/llvm-project/commit/622354a522073b0a048a88c957b161fb376a40eb DIFF: https://github.com/llvm/llvm-project/commit/622354a522073b0a048a88c957b161fb376a40eb.diff L

[clang] 622354a - [llvm][ADT] Implement `BitVector::{pop_,}back`

2022-01-21 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2022-01-21T14:50:53+01:00 New Revision: 622354a522073b0a048a88c957b161fb376a40eb URL: https://github.com/llvm/llvm-project/commit/622354a522073b0a048a88c957b161fb376a40eb DIFF: https://github.com/llvm/llvm-project/commit/622354a522073b0a048a88c957b161fb376a40eb.diff L

[clang] 600c671 - [clang][syntax] Replace `std::vector` use

2022-01-26 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2022-01-26T11:20:18+01:00 New Revision: 600c6714ac77915b7b656b860cf71494a7c9ec7f URL: https://github.com/llvm/llvm-project/commit/600c6714ac77915b7b656b860cf71494a7c9ec7f DIFF: https://github.com/llvm/llvm-project/commit/600c6714ac77915b7b656b860cf71494a7c9ec7f.diff L

[clang] 76cb4cd - [clang] Fix serialized diagnostics edge-cases

2022-01-26 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2022-01-26T11:21:51+01:00 New Revision: 76cb4cd074a6816f3801fd4a2bd8854597748239 URL: https://github.com/llvm/llvm-project/commit/76cb4cd074a6816f3801fd4a2bd8854597748239 DIFF: https://github.com/llvm/llvm-project/commit/76cb4cd074a6816f3801fd4a2bd8854597748239.diff L

[clang] f720272 - [clang][lex] Include tracking: simplify and move to preprocessor

2022-01-26 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2022-01-26T15:56:26+01:00 New Revision: f7202723304461c4f94399b906333d6ede85579a URL: https://github.com/llvm/llvm-project/commit/f7202723304461c4f94399b906333d6ede85579a DIFF: https://github.com/llvm/llvm-project/commit/f7202723304461c4f94399b906333d6ede85579a.diff L

[clang] 27d9a58 - [clang][modules] Infer framework modules in explicit builds

2022-02-23 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2022-02-23T14:46:23+01:00 New Revision: 27d9a58407c44c8bb3fe7b94ff8d3b9bea25afc4 URL: https://github.com/llvm/llvm-project/commit/27d9a58407c44c8bb3fe7b94ff8d3b9bea25afc4 DIFF: https://github.com/llvm/llvm-project/commit/27d9a58407c44c8bb3fe7b94ff8d3b9bea25afc4.diff L

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