[clang] [Clang] Allow raw string literals in C as an extension (PR #88265)

2024-06-21 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: I assume that @benlangmuir added the scanner unit-test to demonstrate the current behavior instead of trying to make sure it's preserved. I think making it so that the test passes (actually handles raw string literals) and updating the FIXME in `DependencyDirectivesScanner.

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

2024-06-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] [clang] Fix incomplete umbrella warnings when building clang modules (NFC) (PR #96939)

2024-06-27 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. LGTM, but I'd prefer to land the re-ordering in a separate commit. https://github.com/llvm/llvm-project/pull/96939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

2024-06-28 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > My main concern with this approach is I'm not sure that after fixing the > memory issue we don't have a remaining logic bug. Because we are still > modifying `ModuleMap::Headers` during `ASTWriter::WriteHeaderSearch` > iteration and that looks suspicious. Need to think ho

[clang] [clang][deps] Print tracing VFS data (PR #108056)

2024-09-11 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/108056 >From 9b9d8f02e26839758c51c7e48c1ba43dc3c24146 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 10 Sep 2024 09:55:07 -0700 Subject: [PATCH 1/2] [clang][deps] Print tracing VFS data --- .../Dependency

[clang] [clang][deps] Print tracing VFS data (PR #108056)

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

[clang] [CGData] Clang Options (PR #90304)

2024-09-12 Thread Jan Svoboda via cfe-commits
@@ -1894,6 +1894,18 @@ def fprofile_selected_function_group : Visibility<[ClangOption, CC1Option]>, MetaVarName<"">, HelpText<"Partition functions into N groups using -fprofile-function-groups and select only functions in group i to be instrumented. The valid range is 0 to

[clang] [clang-scan-deps] Infer the target from the executable name (PR #108189)

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

[clang] [Modules] Add -cc1 -flate-module-map-file to load module maps after PCMs (PR #88893)

2024-09-12 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. Thanks for the explanation! This LGTM, but I agree with the sentiment that I'd be nice to have this as the default behavior. Any effort towards that would be appreciated! https://github.com/llvm/llvm-project/pull/88893 ___

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-09-12 Thread Jan Svoboda via cfe-commits
@@ -4772,6 +4772,23 @@ bool ASTWriter::PreparePathForOutput(SmallVectorImpl &Path) { Changed = true; } + // If we are generating a normal PCH (EG. not a C++ module). + if (!WritingModule) { +// Use the vfs overlay if it exists to translate paths. +auto &FileSy

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-09-12 Thread Jan Svoboda via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: rm -rf %t +// RUN: mkdir -p %t/From +// RUN: mkdir -p %t/To +// RUN: echo '#pragma once' > %t/From/B.h jansvoboda11 wrote: Could you rewrite the test using `split-file`? That is much easier to read. https://github.com/llvm/llvm-project/

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-09-12 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 commented: Instead of using VFS overlays to make the AST file relocatable, have you considered making use of `adjustFilenameForRelocatableAST()` (i.e. storing relative paths to the AST file) and then setting the CWD accordingly when loading? https://github.com/

[clang] [clang-scan-deps] Infer the target from the executable name (PR #108189)

2024-09-12 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: No objections on my part. https://github.com/llvm/llvm-project/pull/108189 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CGData] Clang Options (PR #90304)

2024-09-12 Thread Jan Svoboda via cfe-commits
@@ -2753,6 +2753,33 @@ void tools::addMachineOutlinerArgs(const Driver &D, addArg(Twine("-enable-machine-outliner=never")); } } + + auto *CodeGenDataGenArg = + Args.getLastArg(options::OPT_fcodegen_data_generate, jansvoboda11 wrote: Since `fc

[clang] [clang-scan-deps] Infer the tool locations from PATH (PR #108539)

2024-09-13 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Can you explain why exactly is this necessary/beneficial? If the compilation database got created with just the tool name, I'd expect the rest of the build to be able to use just the tool name when the scanner spits it out again, no? If this is about the scanner finding the

[clang] [clang-scan-deps] Infer the tool locations from PATH (PR #108539)

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

[clang] [CGData] Clang Options (PR #90304)

2024-09-13 Thread Jan Svoboda via cfe-commits
@@ -2753,6 +2753,31 @@ void tools::addMachineOutlinerArgs(const Driver &D, addArg(Twine("-enable-machine-outliner=never")); } } + + auto *CodeGenDataGenArg = + Args.getLastArg(options::OPT_fcodegen_data_generate_EQ); + auto *CodeGenDataUseArg = Args.getLastAr

[clang] [CGData] Clang Options (PR #90304)

2024-09-13 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: The options handling part LGTM, but I'll let others review the actual semantics of this PR. https://github.com/llvm/llvm-project/pull/90304 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [clang][deps] Serialize JSON without creating intermediate objects (PR #111734)

2024-10-09 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/111734 >From c4c5b9cd372707a53cfe1948ab3881a8a64001a3 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 8 Oct 2024 16:21:40 -0700 Subject: [PATCH 1/2] [clang][deps] Serialize JSON without creating intermediat

[clang] [clang][deps] Serialize JSON without creating intermediate objects (PR #111734)

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

[clang] [clang][deps] Serialize JSON without creating intermediate objects (PR #111734)

2024-10-09 Thread Jan Svoboda via cfe-commits
@@ -450,58 +458,65 @@ class FullDeps { ModuleIDs.push_back(M.first); llvm::sort(ModuleIDs); -using namespace llvm::json; - -Array OutModules; -for (auto &&ModID : ModuleIDs) { - auto &MD = Modules[ModID]; - Object O{{"name", MD.ID.ModuleName}, -

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

2024-10-16 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: The issue with the current state of things in Clang is that if you have N instances waiting for a PCM file to be built, they all load the PCM file as soon as the lock is released by the writer. They all find out that there's no timestamp file and attempt to write it after t

[clang] [clang] Allocate `Module` instances in `BumpPtrAllocator` (PR #112795)

2024-10-17 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/112795 In `clang-scan-deps`, we're creating lots of `Module` instances. Allocating them all in a bump-pointer allocator reduces the number of retired instructions by 1-1.5% on my workload. >From 7e00bbe74f71c55d

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

2024-10-17 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > Have you checked the performance for incremental builds? I haven't, since I believe this change doesn't affect incremental builds at all. https://github.com/llvm/llvm-project/pull/112452 ___ cfe-commits mailing list cfe-commits@l

[clang] [clang][modules] Preserve the module map that allowed inferring (PR #113389)

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

[clang] [clang][modules] Preserve the module map that allowed inferring (PR #113389)

2024-10-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/113389 With inferred modules, the dependency scanner takes care to replace the fake "__inferred_module.map" path with the file that allowed the module to be inferred. However, this only worked when such a module

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

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

[clang] [clang][modules] Optimize construction and usage of the submodule index (PR #113391)

2024-10-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/113391 This patch avoids eagerly populating the submodule index on `Module` construction. The `StringMap` allocation shows up in my profiles of `clang-scan-deps`, while the index is not necessary most of the time

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

2024-10-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/113395 This patch shrinks the size of the `Module` class from 2112B to 1624B. I wasn't able to get a good data on the actual impact on memory usage, but given my `clang-scan-deps` workload at hand (with tens of t

[clang] [clang] Allocate `Module` instances in `BumpPtrAllocator` (PR #112795)

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

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

2024-10-22 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/112452 >From 6550eecf945d5a8537242646ef17b49b49eff859 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 15 Oct 2024 16:29:37 -0700 Subject: [PATCH 1/2] [clang][modules] Timestamp PCM files when writing Clang

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-29 Thread Jan Svoboda via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/113984 When reading a path from a bitstream blob, `ASTReader` performs up to three allocations: 1. Conversion of the `StringRef` blob into `std::string` to conform to the `ASTReader::ResolveImportedPath()` API t

[clang] 19131c7 - [clang][modules][lldb] Fix build after #113391

2024-10-28 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2024-10-28T12:50:53-07:00 New Revision: 19131c7f36e047898ea954ee5a187ac62f2ab09b URL: https://github.com/llvm/llvm-project/commit/19131c7f36e047898ea954ee5a187ac62f2ab09b DIFF: https://github.com/llvm/llvm-project/commit/19131c7f36e047898ea954ee5a187ac62f2ab09b.diff L

[clang] [clang][modules] Optimize construction and usage of the submodule index (PR #113391)

2024-10-28 Thread Jan Svoboda via cfe-commits
@@ -541,11 +541,14 @@ class ModuleMap { /// /// \param IsExplicit Whether this is an explicit submodule. /// - /// \returns The found or newly-created module, along with a boolean value - /// that will be true if the module is newly-created. - std::pair findOrCreateMod

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

2024-10-24 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/113395 >From 09246d11c8663c0b2b31317eddc297c1d29fcd60 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 22 Oct 2024 16:07:27 -0700 Subject: [PATCH 1/3] [clang][modules] Shrink the size of `Module::Headers` Th

[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 updated https://github.com/llvm/llvm-project/pull/113395 >From 09246d11c8663c0b2b31317eddc297c1d29fcd60 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 22 Oct 2024 16:07:27 -0700 Subject: [PATCH 1/4] [clang][modules] Shrink the size of `Module::Headers` Th

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

2024-10-24 Thread Jan Svoboda via cfe-commits
@@ -271,8 +271,22 @@ class alignas(8) Module { DirectoryEntryRef Entry; }; - /// The headers that are part of this module. - SmallVector Headers[5]; +private: + unsigned HeaderKindBeginIndex[6] = {}; jansvoboda11 wrote: I used `NumHeaderKinds`, but e

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-29 Thread Jan Svoboda via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-29 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/113984 >From 709cc1c8c41603c4d9eb637cb0453521029af201 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Mon, 28 Oct 2024 16:59:13 -0700 Subject: [PATCH 1/2] [clang][modules] Avoid allocations when reading blob pat

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-29 Thread Jan Svoboda via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

[clang] [clang][deps] Stop sorting file dependencies (PR #114079)

2024-10-29 Thread Jan Svoboda via cfe-commits
@@ -472,7 +465,8 @@ class FullDeps { JOS.attributeArray("command-line", toJSONStrings(JOS, MD.getBuildArguments())); JOS.attribute("context-hash", StringRef(MD.ID.ContextHash)); -JOS.attributeArray("file-deps",

[clang] [clang][deps] Stop sorting file dependencies (PR #114079)

2024-10-29 Thread Jan Svoboda via cfe-commits
@@ -34,8 +34,8 @@ module mod { header "mod.h" } // CHECK:], // CHECK-NEXT: "context-hash": "[[HASH_MOD:.*]]", // CHECK-NEXT: "file-deps": [ -// CHECK-NEXT: "[[PREFIX]]/mod.h" -// CHECK-NEXT: "[[PREFIX]]/module.modulemap" +// CHECK-DAG:

[clang] [clang][deps] Stop relying on name of inferred module maps (PR #114085)

2024-10-29 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/114085 What the special case for `"__inferred_module.map"` was getting at is that in general we cannot report overridden files as dependencies: neither the build system nor Clang itself won't know what to do with

[clang] [clang][deps] Stop sorting file dependencies (PR #114079)

2024-10-29 Thread Jan Svoboda via cfe-commits
@@ -472,7 +465,8 @@ class FullDeps { JOS.attributeArray("command-line", toJSONStrings(JOS, MD.getBuildArguments())); JOS.attribute("context-hash", StringRef(MD.ID.ContextHash)); -JOS.attributeArray("file-deps",

[clang] [clang][deps] Stop sorting file dependencies (PR #114079)

2024-10-29 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/114079 The dependency scanner collects file dependencies of modules into a `llvm::StringSet`. However, we don't need the deduplication it performs, since that's already guaranteed by the PCM we read the paths fro

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

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

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-28 Thread Jan Svoboda via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-28 Thread Jan Svoboda via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-28 Thread Jan Svoboda via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-28 Thread Jan Svoboda via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

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

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

2024-11-05 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/115065 The `FileManager` sharing between module-building `CompilerInstance`s was disabled a while ago due to `FileEntry::getName()` being unreliable. Now that we use `FileEntryRef::getNameAsRequested()` in places

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-30 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/113984 >From 709cc1c8c41603c4d9eb637cb0453521029af201 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Mon, 28 Oct 2024 16:59:13 -0700 Subject: [PATCH 1/3] [clang][modules] Avoid allocations when reading blob pat

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-30 Thread Jan Svoboda via cfe-commits
@@ -1342,19 +1343,47 @@ class ASTReader bool Complain = true); /// Buffer we use as temporary storage backing resolved paths. - SmallString<256> PathBuf; + std::optional> PathBuf{{}}; + + /// A RAII wrapper around \c StringRef that

[clang] [llvm] [clang] NFC: Remove `{File, Directory}Entry::getName()` (PR #74910)

2024-10-30 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: How about something like this? ```c++ auto FE = CI.getFileManager().getOptionalFileEntryRef("foo.h"); bool IsFooIncluded = FE && CI.getPreprocessor().getIncludedFiles().contains(*FE); ``` https://github.com/llvm/llvm-project/pull/74910 __

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

2024-11-01 Thread Jan Svoboda via cfe-commits
@@ -779,23 +795,16 @@ static StringRef makeAbsoluteAndPreferred(CompilerInstance &CI, StringRef Path, void ModuleDepCollector::addFileDep(StringRef Path) { if (IsStdModuleP1689Format) { // Within P1689 format, we don't want all the paths to be absolute path -// since

[clang] [clang][deps] Stop relying on name of inferred module maps (PR #114085)

2024-11-01 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > Can this be tested? Hmm, I'm not sure. The current tests for inferred module maps still pass. The other ways how `SourceManager` ends up overwriting a file are: * is by using the `-remap-file`, which is unsupported with modules (`ASTWriter` intentionally asserts), * using

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

2024-11-01 Thread Jan Svoboda via cfe-commits
@@ -779,23 +795,16 @@ static StringRef makeAbsoluteAndPreferred(CompilerInstance &CI, StringRef Path, void ModuleDepCollector::addFileDep(StringRef Path) { if (IsStdModuleP1689Format) { // Within P1689 format, we don't want all the paths to be absolute path -// since

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

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

[clang] [clang] Move VFS overlays from `HeaderSearchOptions` to `FileSystemOptions` (PR #86534)

2024-11-02 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/86534 >From d49ef2de83b37156ab73c0028676d9b0425ef2ed Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Mon, 25 Mar 2024 10:15:33 -0700 Subject: [PATCH] [clang] Move VFS overlays from `HeaderSearchOptions` to `File

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

2024-10-25 Thread Jan Svoboda via cfe-commits
@@ -263,17 +261,36 @@ class alignas(8) Module { FileEntryRef Entry; }; - /// Information about a directory name as found in the module map - /// file. +private: + static const int NumHeaderKinds = HK_Excluded + 1; + // The begin index for a HeaderKind also acts the e

[clang] [clang][modules] Preserve the module map that allowed inferring (PR #113389)

2024-10-28 Thread Jan Svoboda via cfe-commits
@@ -3018,13 +3019,19 @@ void ASTWriter::WriteSubmodules(Module *WritingModule) { SourceLocationEncoding::RawLocEncoding DefinitionLoc = getRawSourceLocationEncoding(getAdjustedLocation(Mod->DefinitionLoc)); +ModuleMap &ModMap = PP->getHeaderSearchInfo().getModu

[clang] [clang][modules] Preserve the module map that allowed inferring (PR #113389)

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

[clang] [clang][modules] Optimize construction and usage of the submodule index (PR #113391)

2024-10-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/113391 >From c795bab6ec59676daaa3ef67077b9a738dd93839 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 22 Oct 2024 15:46:07 -0700 Subject: [PATCH 1/2] [clang][modules] Optimize construction and usage of the

[clang] [clang][modules] Preserve the module map that allowed inferring (PR #113389)

2024-10-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/113389 >From efcd62d35fe296b2bd4fe5cdbec9ab96493a885f Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 22 Oct 2024 14:01:45 -0700 Subject: [PATCH 1/2] [clang][modules] Preserve the module map that allowed in

[clang] [clang][modules] Optimize construction and usage of the submodule index (PR #113391)

2024-10-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/113391 >From c6ff124355209de31c86096eb2ede14d598aa5cd Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 22 Oct 2024 15:46:07 -0700 Subject: [PATCH 1/2] [clang][modules] Optimize construction and usage of the

[clang] [clang][modules] Optimize construction and usage of the submodule index (PR #113391)

2024-10-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/113391 ___ 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-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/113726 >From 58056a40734ee2a64dca37f7669f77f2447f492c Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 25 Oct 2024 11:42:58 -0700 Subject: [PATCH 1/2] [clang][deps] Improve timing output This patch adds the

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

2024-10-28 Thread Jan Svoboda via cfe-commits
@@ -34,6 +34,7 @@ def deprecated_driver_command : F<"deprecated-driver-command", "use a single dri defm resource_dir_recipe : Eq<"resource-dir-recipe", "How to produce missing '-resource-dir' argument">; def print_timing : F<"print-timing", "Print timing information">; +def

[clang] [clang][modules] Optimize construction and usage of the submodule index (PR #113391)

2024-10-28 Thread Jan Svoboda via cfe-commits
@@ -541,11 +541,14 @@ class ModuleMap { /// /// \param IsExplicit Whether this is an explicit submodule. /// - /// \returns The found or newly-created module, along with a boolean value - /// that will be true if the module is newly-created. - std::pair findOrCreateMod

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

2024-10-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/113726 ___ 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-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 edited https://github.com/llvm/llvm-project/pull/113726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

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

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

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

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

2024-11-11 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/3] [clang][serialization] Make `ASTWriter` accept `Preproces

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

2024-11-11 Thread Jan Svoboda via cfe-commits
@@ -4858,14 +4860,21 @@ time_t ASTWriter::getTimestampForOutput(const FileEntry *E) const { return IncludeTimestamps ? E->getModificationTime() : 0; } -ASTFileSignature ASTWriter::WriteAST(Sema &SemaRef, StringRef OutputFile, - Module *Wr

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

2024-11-11 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed 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] Enable `ASTWriter` to work with `Preprocessor` only (PR #115237)

2024-11-11 Thread Jan Svoboda via cfe-commits
@@ -661,8 +661,8 @@ class ASTWriter : public ASTDeserializationListener, /// Write a precompiled header for the given semantic analysis. /// - /// \param SemaRef a reference to the semantic analysis object that processed - /// the AST to be written into the precompiled h

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

2024-11-11 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/115239 >From 136e484907d24f1ba0efc4f658fabcdb95fa8498 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 6 Nov 2024 14:16:51 -0800 Subject: [PATCH 1/2] [clang][deps] Only write preprocessor info into PCMs ---

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

2024-11-13 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/116095 This PR changes a part of the PCM format to store string-like things in the blob attached to a record instead of VBR6-encoding them into the record itself. Applied to the `IMPORTS` section (which is very h

[clang] [clang][modules] De-duplicate some logic in `HeaderFileInfoTrait` (PR #114330)

2024-10-30 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/114330 None >From c11ea47908e93fedf83021377f904d296802e627 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 30 Oct 2024 16:52:42 -0700 Subject: [PATCH] [clang][modules] De-duplicate some logic in `HeaderFil

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-31 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/113984 >From c11ea47908e93fedf83021377f904d296802e627 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 30 Oct 2024 16:52:42 -0700 Subject: [PATCH 1/6] [clang][modules] De-duplicate some logic in `HeaderFileI

[clang] [clang][modules] De-duplicate some logic in `HeaderFileInfoTrait` (PR #114330)

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

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-31 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/113984 >From c11ea47908e93fedf83021377f904d296802e627 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 30 Oct 2024 16:52:42 -0700 Subject: [PATCH 1/6] [clang][modules] De-duplicate some logic in `HeaderFileI

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

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

[clang] [clang][lex] Remove `-index-header-map` (PR #114459)

2024-10-31 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/114459 This PR removes the `-index-header-map` functionality from Clang. AFAIK this was only used internally at Apple and is now dead code. The main motivation behind this change is to enable the removal of `Head

[clang] [clang-tools-extra] [clang][lex] Remove `HeaderFileInfo::Framework` (PR #114460)

2024-10-31 Thread Jan Svoboda via cfe-commits
@@ -2045,21 +2041,7 @@ namespace { LE.write( Writer.getIdentifierRef(Data.HFI.LazyControllingMacro.getPtr())); - unsigned Offset = 0; - if (!Data.HFI.Framework.empty()) { -// If this header refers into a framework, save the framework name.

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

2024-10-31 Thread Jan Svoboda via cfe-commits
@@ -21,6 +21,16 @@ using namespace clang; using namespace tooling; using namespace dependencies; +void ModuleDeps::forEachFileDep(llvm::function_ref Cb) const { + SmallString<0> PathBuf; + PathBuf.reserve(256); jansvoboda11 wrote: Curious what people think

[clang] [clang][deps] Stop sorting file dependencies (PR #114079)

2024-10-31 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Ok, abandoning in favor of #114457. https://github.com/llvm/llvm-project/pull/114079 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Stop sorting file dependencies (PR #114079)

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

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

2024-10-31 Thread Jan Svoboda via cfe-commits
@@ -779,23 +795,16 @@ static StringRef makeAbsoluteAndPreferred(CompilerInstance &CI, StringRef Path, void ModuleDepCollector::addFileDep(StringRef Path) { if (IsStdModuleP1689Format) { // Within P1689 format, we don't want all the paths to be absolute path -// since

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

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

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

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

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

2024-10-31 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/114457 This PR builds on top of #113984 and attempts to avoid allocating input file paths eagerly. Instead, the `InputFileInfo` type used by `ASTReader` now only holds `StringRef`s that point into the PCM file bu

[clang] [clang-tools-extra] [clang][lex] Remove `HeaderFileInfo::Framework` (PR #114460)

2024-10-31 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/114460 This PR removes the `HeaderFileInfo::Framework` member and reduces the size of this data type from 32B to 16B. This should improve Clang's memory usage in situations where it keeps track of lots of header

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

2024-10-31 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/114457 >From 3be61a8f1eecdc64c0df5d6635f5bf7809c31de4 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 22 Oct 2024 09:41:18 -0700 Subject: [PATCH 1/2] [clang][deps][modules] Reduce allocations of input file

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

2024-10-31 Thread Jan Svoboda via cfe-commits
@@ -472,7 +465,9 @@ class FullDeps { JOS.attributeArray("command-line", toJSONStrings(JOS, MD.getBuildArguments())); JOS.attribute("context-hash", StringRef(MD.ID.ContextHash)); -JOS.attributeArray("file-deps",

[clang] [clang][lex] Remove `-index-header-map` (PR #114459)

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

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

2024-09-18 Thread Jan Svoboda via cfe-commits
@@ -839,9 +839,11 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { auto R = std::make_reverse_iterator(FlagsEnd); for (auto I = R, E = Args.rend(); I != E; ++I) { StringRef Arg = *I; +if ((I + 1) == E)

<    7   8   9   10   11   12   13   14   15   16   >