[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-06 Thread Michael Spencer via cfe-commits
@@ -932,6 +932,12 @@ def warn_module_conflict : Warning< InGroup; // C++20 modules +def err_module_decl_cannot_be_macros : Error< + "the name of a module%select{| partition}0 declaration cannot contains " + "an object-like macro %1, and the macro will not expand" + "%sele

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-06 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese edited https://github.com/llvm/llvm-project/pull/90574 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [clang][modules] stdarg.h and stddef.h shouldn't directly declare anything (PR #90676)

2024-05-06 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/90676 ___ 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 Michael Spencer via cfe-commits
Bigcheese 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, but I'm not s

[clang] 0419242 - [Clang][ScanDeps] Use the virtual path for module maps

2021-12-14 Thread Michael Spencer via cfe-commits
Author: Michael Spencer Date: 2021-12-14T11:21:42-07:00 New Revision: 04192422c4e3b730c580498b8e948088cb15580b URL: https://github.com/llvm/llvm-project/commit/04192422c4e3b730c580498b8e948088cb15580b DIFF: https://github.com/llvm/llvm-project/commit/04192422c4e3b730c580498b8e948088cb15580b.dif

Re: [PATCH] D114206: [Clang][ScanDeps] Use the virtual path for module maps

2021-12-14 Thread Michael Spencer via cfe-commits
On Tue, Dec 14, 2021 at 6:17 PM Richard Smith - zygoloid via Phabricator < revi...@reviews.llvm.org> wrote: > rsmith added inline comments. > > > > Comment at: clang/test/ClangScanDeps/modulemap-via-vfs.m:5-6 > +// RUN: sed -e "s|DIR|%/t.dir|g" %t.dir/build/vfs.yaml.in > > %t.dir/

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-01-30 Thread Michael Spencer via cfe-commits
Bigcheese wrote: It has to happen after the header search optimization in case that removes relative header search paths. https://github.com/llvm/llvm-project/pull/124786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-02-04 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. Looks good, thanks! https://github.com/llvm/llvm-project/pull/124786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Separate parsing of modulemaps (PR #119740)

2025-02-05 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/119740 >From 51e010b52debe020edaf707a8aa089fe3fad16cb Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Thu, 5 Dec 2024 14:53:50 -0800 Subject: [PATCH] [clang][modules] Separate parsing of modulemaps This separat

[clang] [DependencyScanning] Add ability to scan TU with a buffer input (PR #125111)

2025-01-30 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,111 @@ +// UNSUPPORTED: target=powerpc64-ibm-aix{{.*}} + +// RUN: rm -rf %t +// RUN: split-file %s %t + +//--- module.modulemap +module root { header "root.h" } +module direct { header "direct.h" } +module transitive { header "transitive.h" } +module addition { header "

[clang] [llvm] [clang][Modules] Fixing Build Breaks When -DLLVM_ENABLE_MODULES=ON (PR #119473)

2024-12-10 Thread Michael Spencer via cfe-commits
@@ -14,8 +14,6 @@ #ifndef CLANG_SUPPORT_COMPILER_H #define CLANG_SUPPORT_COMPILER_H -#include "llvm/Support/Compiler.h" Bigcheese wrote: The include of this file needs to move to Attr.h, module imports can't be in a namespace, so putting the include in Attrs

[clang] [llvm] [clang][modules] Separate parsing of modulemaps (PR #119740)

2024-12-12 Thread Michael Spencer via cfe-commits
@@ -2596,6 +2596,15 @@ template using has_sizeof = decltype(sizeof(T)); template constexpr bool is_incomplete_v = !is_detected::value; +//===--===// +// Extra additions to +//===---

[clang] [llvm] [clang][modules] Separate parsing of modulemaps (PR #119740)

2024-12-12 Thread Michael Spencer via cfe-commits
@@ -2596,6 +2596,15 @@ template using has_sizeof = decltype(sizeof(T)); template constexpr bool is_incomplete_v = !is_detected::value; +//===--===// +// Extra additions to +//===---

[clang] [llvm] [clang][modules] Separate parsing of modulemaps (PR #119740)

2024-12-12 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/119740 This separates out parsing of modulemaps from updating the `clang::ModuleMap` information. Currently this has no effect other than slightly changing diagnostics. Upcoming changes will use this to allow searc

[clang] [clang][modules] Separate parsing of modulemaps (PR #119740)

2024-12-12 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/119740 >From 11faee533d07aff6955d44bda0d502888e52e119 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Thu, 5 Dec 2024 14:53:50 -0800 Subject: [PATCH] [clang][modules] Separate parsing of modulemaps This separat

[clang] [llvm] [clang][modules] Separate parsing of modulemaps (PR #119740)

2024-12-12 Thread Michael Spencer via cfe-commits
@@ -2596,6 +2596,15 @@ template using has_sizeof = decltype(sizeof(T)); template constexpr bool is_incomplete_v = !is_detected::value; +//===--===// +// Extra additions to +//===---

[clang] [Serialization] Downgrade error to warning for inconsistent language flags (PR #117840)

2024-12-03 Thread Michael Spencer via cfe-commits
Bigcheese wrote: I think going down this path is going to cause real issues for users. There's a reason this behavior was added in the first place for Clang modules, as Clang makes assumptions about the shape of the AST which can lead to crashes in some cases. For example, in real world code t

[clang] [clang][modules] Separate parsing of modulemaps (PR #119740)

2025-01-11 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,141 @@ +//===- ModuleMapFile.h - Parsing and representation -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][modules] Separate parsing of modulemaps (PR #119740)

2025-01-11 Thread Michael Spencer via cfe-commits
@@ -1575,305 +1494,45 @@ namespace clang { /// 'textual' to match the original intent. llvm::SmallPtrSet UsesRequiresExcludedHack; -/// Consume the current token and return its location. -SourceLocation consumeToken(); - -/// Skip tokens until we reach the

[clang] [clang][modules] Separate parsing of modulemaps (PR #119740)

2025-01-11 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,141 @@ +//===- ModuleMapFile.h - Parsing and representation -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][modules] Separate parsing of modulemaps (PR #119740)

2025-01-11 Thread Michael Spencer via cfe-commits
@@ -3157,25 +2140,18 @@ bool ModuleMap::parseModuleMapFile(FileEntryRef File, bool IsSystem, assert((!Offset || *Offset <= Buffer->getBufferSize()) && "invalid buffer offset"); - // Parse this module map file. - Lexer L(SourceMgr.getLocForStartOfFile(ID), MMapLan

[clang] [clang][modules] Separate parsing of modulemaps (PR #119740)

2025-01-11 Thread Michael Spencer via cfe-commits
Bigcheese wrote: > I'm happy with the way this split of the code worked out! > > > Currently this has no effect other than slightly changing diagnostics. > > Can you say more about the ordering changes? I understand we can't always > emit diagnostics in source order, but it's helpful for reada

[clang] Clang/Preprocessor: Support short circuit in directive (PR #123912)

2025-01-22 Thread Michael Spencer via cfe-commits
Bigcheese wrote: It's an alternative to https://github.com/llvm/llvm-project/pull/120673 This resolves my concerns with the original patch, and I'm pretty sure it doesn't cause any other issues, but I do plan to take a closer look in a bit. https://github.com/llvm/llvm-project/pull/123912

[clang] [clang][Modules] Raise empty.modulemap expected size to <70KB to fix RISC-V failure (PR #123959)

2025-01-23 Thread Michael Spencer via cfe-commits
Bigcheese wrote: It could be due to builtins, I believe we always serialize them, and that would be different between targets. Does RISC-V have a lot of them compared to other targets? https://github.com/llvm/llvm-project/pull/123959 ___ cfe-commits

[clang] [clang module] Current Working Directory Pruning (PR #124786)

2025-01-29 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese requested changes to this pull request. This looks like the right approach, but I think it would be good to have a test for the relative path checking. Not every option needs a test, just one should be fine. https://github.com/llvm/llvm-project/pull/124786

[clang] [clang-tools-extra] Clang/Preprocessor: Not add headers of __has_include into DepColloctor (PR #120673)

2025-01-14 Thread Michael Spencer via cfe-commits
Bigcheese wrote: It's intentional that Clang reports these as dependencies. What issue do you have where you think this is the wrong behavior? More specifically, https://reviews.llvm.org/D30882 originally added the behavior. This references an internal Apple bug that occurred when you have co

[clang] [clang-tools-extra] Clang/Preprocessor: Not add headers of __has_include into DepColloctor (PR #120673)

2025-01-15 Thread Michael Spencer via cfe-commits
Bigcheese wrote: > > It's intentional that Clang reports these as dependencies. What issue do > > you have where you think this is the wrong behavior? > > A test case of glibc emit error for this behavior: > > * check-local-headers > > > More specifically, https://reviews.llvm.org/D30882 orig

[clang] [clang] Mark some language options as benign. (PR #131569)

2025-03-18 Thread Michael Spencer via cfe-commits
Bigcheese wrote: The general issue with changing this to benign is that it ends up being non-deterministic and buggy for implicitly built modules. I think what we want here is `COMPATIBLE_LANGOPT`. By default it will still feed into the context hash, but the compiler won't reject loading such

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

2025-03-19 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. https://github.com/llvm/llvm-project/pull/132063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-03-21 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. I think this looks good now. Also nice in general to not mess with options after argument parsing. https://github.com/llvm/llvm-project/pull/130823 ___ cfe-commits mailing list cfe-commits@lists

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

2025-03-24 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/132853 Instead of eagerly populating the `clang::ModuleMap` when looking up a module by name, this patch changes `HeaderSearch` to only load the modules that are actually used. This introduces `ModuleMap::findOrLoa

[clang] [clang][DependencyScanning] Track modules that resolve from sysroot. (PR #130634)

2025-03-14 Thread Michael Spencer via cfe-commits
@@ -843,7 +864,7 @@ void ModuleDepCollectorPP::addModuleDep( !MDC.isPrebuiltModule(Import)) { Bigcheese wrote: I think that's fine as long as the current patch says that pre built modules means it's not in sysroot, as I think that's a small addition and

[clang] [clang][DependencyScanning] Track modules that resolve from sysroot. (PR #130634)

2025-03-14 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese edited https://github.com/llvm/llvm-project/pull/130634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] [C++20] [Modules] Add modules suffix for 'Header' Source Switch (PR #131591)

2025-03-17 Thread Michael Spencer via cfe-commits
Bigcheese wrote: Is the expectation here that people will name implementation units "foo.cpp" and the corresponding interface unit "foo.cppm"? I guess that's reasonable. https://github.com/llvm/llvm-project/pull/131591 ___ cfe-commits mailing list cfe

[clang] [clang][modules] Correctly set module map systemness (PR #131940)

2025-03-19 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/131940 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

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

2025-03-25 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/132970 >From 1dca90893cd12709f7d3952b68b552fe93b19c5d Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Tue, 25 Mar 2025 11:14:46 -0700 Subject: [PATCH] [clang] Consistently use "load" to refer to populating clan

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

2025-03-25 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/132970 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 53fa289 - [clang] Remove unused member variable from ModuleMap

2025-03-25 Thread Michael Spencer via cfe-commits
Author: Michael Spencer Date: 2025-03-25T10:58:44-07:00 New Revision: 53fa28940e0a3ef183e04dd8bc8566d64bbfd101 URL: https://github.com/llvm/llvm-project/commit/53fa28940e0a3ef183e04dd8bc8566d64bbfd101 DIFF: https://github.com/llvm/llvm-project/commit/53fa28940e0a3ef183e04dd8bc8566d64bbfd101.dif

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

2025-03-25 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/132970 Now that we have ModuleMapFile.cpp which parses module maps, it's confusing what ModuleMap::parseModuleMapFile actually does. HeaderSearch already called this loading a module map, so consistently use that te

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

2025-03-25 Thread Michael Spencer via cfe-commits
@@ -1801,6 +1801,33 @@ HeaderSearch::loadModuleMapFileImpl(FileEntryRef File, bool IsSystem, return LMM_NewlyLoaded; } +HeaderSearch::LoadModuleMapResult +HeaderSearch::parseModuleMapFileImpl(FileEntryRef File, bool IsSystem, Bigcheese wrote: https://githu

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

2025-03-25 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. There's no point in having vague ownership here, so this lgtm. https://github.com/llvm/llvm-project/pull/132780 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-03-26 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,115 @@ +//===--- RunOnNewStack.cpp - Crash Recovery ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-03-26 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/133173 Clang spawns a new thread to avoid running out of stack space. This can make debugging and performance analysis more difficult as how the threads are connected is difficult to recover. This patch introduces

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-03-27 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,115 @@ +//===--- RunOnNewStack.cpp - Crash Recovery ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][DependencyScanning] Track modules that resolve from sysroot. (PR #130634)

2025-03-15 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese commented: Overall I think this looks good. I'm not sure I share the same concerns. The situation this covers is how likely is it that the build system is going to determine this needs to be rebuilt, and that happens (in most cases) purely based on the reported dep

[clang] [clang][frontend] Make `CompilerInstance::FailedModules` thread-safe (PR #135473)

2025-04-14 Thread Michael Spencer via cfe-commits
@@ -1206,82 +1198,70 @@ createCompilerInstanceForModuleCompileImpl(CompilerInstance &ImportingInstance, DiagnosticOptions &DiagOpts = Invocation->getDiagnosticOpts(); DiagOpts.VerifyDiagnostics = 0; - assert(ImportingInstance.getInvocation().getModuleHash() == -

[clang] [Preprocessor] Do not expand macros if the input is already preprocessed (PR #137665)

2025-04-30 Thread Michael Spencer via cfe-commits
Juan Manuel Martinez =?utf-8?q?Caamaño?= Message-ID: In-Reply-To: Bigcheese wrote: module maps don't get preprocessed, so I don't think it matters what that is set to. For normal module.modulemap files `Preprocessed` is `false`. I think it's fine to remove the true and see if anything breaks

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

2025-04-30 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. Makes sense. Every non-test creation of `CompilerInstance` has an associated invocation. https://github.com/llvm/llvm-project/pull/137668 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2025-04-29 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. I think this looks good overall. I'm a little concerned that the single file and single module names are similar while having quite different semantics, but single file is never actually exposed to users, so they won't be confused. I don

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-04-10 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/133173 >From 52b33e2511a2e775e78471fbb2c66ad072369168 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Wed, 26 Mar 2025 14:48:19 -0700 Subject: [PATCH] [llvm][clang] Allocate a new stack instead of spawning a new

[clang] [clang] Extract `CompilerInstance` creation out of `compileModuleImpl()` (PR #134887)

2025-04-10 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. I believe that's fine to run, it just may build the index again. https://github.com/llvm/llvm-project/pull/134887 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [llvm] Reland: [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #136046)

2025-04-16 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/136046 Reland https://github.com/llvm/llvm-project/pull/133173. This changes the assembly code to use `.cfi_{start,end}proc` directly in a file scope asm statement and restricts enabling it to MachO to help ensure t

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

2025-04-30 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/132853 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans

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

2025-04-30 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/132853 >From cea7c581ff90952d112d912da02de688e09112f7 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Wed, 29 Jan 2025 12:49:29 -0800 Subject: [PATCH] [clang][modules] Lazily load by name lookups in module maps

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

2025-04-30 Thread Michael Spencer via cfe-commits
Bigcheese wrote: I believe the Linux test failure was due to a test that should have failed. It had a case insensitive VFS for the headers, but not for the modulemap. When looking up `fw.framework/Modules/module.modulemap` it should fail because that path doesn't exist, and isn't made case ins

[clang] [llvm] Reland: [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #136046)

2025-04-30 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,127 @@ +//===--- RunOnNewStack.cpp - Crash Recovery ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] Reset CodeGenOptions fields for clean module/PCH builds (PR #138256)

2025-05-06 Thread Michael Spencer via cfe-commits
@@ -209,20 +209,21 @@ void ModuleDepCollector::addOutputPaths(CowCompilerInvocation &CI, void dependencies::resetBenignCodeGenOptions(frontend::ActionKind ProgramAction, const LangOptions &LangOpts,

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

2025-04-15 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/132853 >From 93fa13d9efabf72032966306473689dfac221857 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Wed, 29 Jan 2025 12:49:29 -0800 Subject: [PATCH] [clang][modules] Lazily load by name lookups in module maps

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-04-15 Thread Michael Spencer via cfe-commits
Bigcheese wrote: And another fix for `!LLVM_ENABLE_THREADS`: 4f64c80d5a23c244f942193e58ecac666c173308 https://github.com/llvm/llvm-project/pull/133173 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-04-15 Thread Michael Spencer via cfe-commits
Bigcheese wrote: I'll have a fix in a sec. https://github.com/llvm/llvm-project/pull/133173 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-04-15 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/133173 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-04-15 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/133173 >From 52b33e2511a2e775e78471fbb2c66ad072369168 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Wed, 26 Mar 2025 14:48:19 -0700 Subject: [PATCH] [llvm][clang] Allocate a new stack instead of spawning a new

[clang] [clang] Extract `CompilerInstance` creation out of `compileModuleImpl()` (PR #134887)

2025-04-10 Thread Michael Spencer via cfe-commits
Bigcheese wrote: Can you not just move the `err_module_rebuild_finalized` diagnostic into `compileModuleImpl`? It has access to everything it needs there. https://github.com/llvm/llvm-project/pull/134887 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [clang][frontend] Make `CompilerInstance::FailedModules` thread-safe (PR #135473)

2025-04-15 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. https://github.com/llvm/llvm-project/pull/135473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][frontend] Make `CompilerInstance::FailedModules` thread-safe (PR #135473)

2025-04-15 Thread Michael Spencer via cfe-commits
@@ -1206,82 +1198,70 @@ createCompilerInstanceForModuleCompileImpl(CompilerInstance &ImportingInstance, DiagnosticOptions &DiagOpts = Invocation->getDiagnosticOpts(); DiagOpts.VerifyDiagnostics = 0; - assert(ImportingInstance.getInvocation().getModuleHash() == -

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

2025-04-29 Thread Michael Spencer 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] Add new -header-include-filtering=direct-per-file option (PR #137087)

2025-04-28 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/137087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add new -header-include-filtering=direct-per-file option (PR #137087)

2025-04-28 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. lgtm. https://github.com/llvm/llvm-project/pull/137087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add new -header-include-filtering=direct-per-file option (PR #137087)

2025-04-28 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese edited https://github.com/llvm/llvm-project/pull/137087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add new -header-include-filtering=direct-per-file option (PR #137087)

2025-04-28 Thread Michael Spencer via cfe-commits
@@ -322,3 +372,81 @@ void HeaderIncludesJSONCallback::FileSkipped( IncludedHeaders.push_back(SkippedFile.getName().str()); } + +void HeaderIncludesDirectPerFileCallback::EndOfMainFile() { + if (Dependencies.empty()) +return; + + // Sort the files so that the output doe

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

2025-04-29 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. lgtm 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] Add `pragma clang scope [push|pop]` (PR #121025)

2025-02-28 Thread Michael Spencer via cfe-commits
@@ -254,7 +285,7 @@ void Preprocessor::updateModuleMacroInfo(const IdentifierInfo *II, } void Preprocessor::dumpMacroInfo(const IdentifierInfo *II) { - ArrayRef Leaf; + ArrayRef Leaf; Bigcheese wrote: This patch has a bunch of unrelated formatting changes,

[clang] Add `pragma clang scope [push|pop]` (PR #121025)

2025-02-28 Thread Michael Spencer via cfe-commits
Bigcheese wrote: Given that some `#pragma`s also impact Sema things, I think `scope` is a bit confusing for what it applies to. I think something like `macro_scope` would be a better name. As for the extension itself, I think it could be useful, but I'm not sure how our language extension pol

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

2025-03-08 Thread Michael Spencer via cfe-commits
@@ -95,6 +96,10 @@ class DependencyScanningService { return SharedCache; } + ModuleCacheMutexes &getSharedModuleCacheMutexes() { Bigcheese wrote: I don't think we need shared_ptr here, the lifetime of workers is already bound to the service. https://

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

2025-03-08 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,31 @@ +#ifndef LLVM_CLANG_SERIALIZATION_MODULECACHELOCK_H +#define LLVM_CLANG_SERIALIZATION_MODULECACHELOCK_H + +#include "clang/Basic/LLVM.h" +#include "llvm/Support/LockFileManager.h" + +namespace clang { +enum class LockResult { Owned, Shared, Error }; +enum class Wa

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

2025-03-09 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. lgtm. This makes a lot more sense. https://github.com/llvm/llvm-project/pull/130395 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

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

2025-03-06 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,66 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

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

2025-03-06 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,66 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

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

2025-03-06 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,39 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

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

2025-03-11 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,39 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

[clang] [clang] Add #pragma clang __debug module_lookup (PR #129158)

2025-02-27 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/129158 This can be used to trigger implicit module map lookup without also importing the module. This can be useful for debugging as it avoids loading the module map from the AST file, which has slightly different s

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-27 Thread Michael Spencer via cfe-commits
Bigcheese wrote: Is there a particular reason to have this be a generic predicate rather than just a bool of if other modules should be visited? I can see how you could do other things with it like skipping a namespace or something, but I'm not sure if the other use cases would actually see us

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-27 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. I think this is good from the modules end and I get how the predicate can be useful. My only concern is that this feels a bit like another matcher that's not using the matcher API, so I'd like someone more familiar with it to also approv

[clang] [llvm] [Support] Return `LockFileManager` errors right away (PR #130627)

2025-03-11 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese edited https://github.com/llvm/llvm-project/pull/130627 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Support] Return `LockFileManager` errors right away (PR #130627)

2025-03-11 Thread Michael Spencer via cfe-commits
@@ -158,41 +160,40 @@ class RemoveUniqueLockFileOnSignal { } // end anonymous namespace LockFileManager::LockFileManager(StringRef FileName) -{ - this->FileName = FileName; - if (std::error_code EC = sys::fs::make_absolute(this->FileName)) { -std::string S("failed to obt

[clang] [llvm] [Support] Return `LockFileManager` errors right away (PR #130627)

2025-03-11 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. lgtm with the one comment. Nice improvement to the API. https://github.com/llvm/llvm-project/pull/130627 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

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

2025-03-13 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. lgtm. https://github.com/llvm/llvm-project/pull/130989 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang dependency scanning] Make Current Working Directory Optimization Off by Default (PR #129809)

2025-03-04 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. Looks good with the added comment. I was going to say this should also update the documentation, but we don't actually have any here. This patch doesn't need to add it, but it would be good to have some documentation on how to actually u

[clang] [clang dependency scanning] Make Current Working Directory Optimization Off by Default (PR #129809)

2025-03-04 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese edited https://github.com/llvm/llvm-project/pull/129809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang dependency scanning] Make Current Working Directory Optimization Off by Default (PR #129809)

2025-03-04 Thread Michael Spencer via cfe-commits
@@ -67,7 +67,7 @@ enum class ScanningOptimizations { IgnoreCWD = (1 << 4), DSS_LAST_BITMASK_ENUM(IgnoreCWD), - Default = All + Default = All & (~IgnoreCWD) Bigcheese wrote: I think there should be a comment here with basically what you said in the comm

[clang] [clang][deps] Remove dependency on llvm targets from lib DependencyScanning (PR #129774)

2025-03-04 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. https://github.com/llvm/llvm-project/pull/129774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-03-12 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,54 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

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

2025-03-12 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,54 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

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

2025-03-12 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,54 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

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

2025-03-12 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,54 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

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

2025-03-12 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese commented: I have a few comments on naming, but overall this looks good. https://github.com/llvm/llvm-project/pull/130989 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

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

2025-03-12 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese edited https://github.com/llvm/llvm-project/pull/130989 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improve module out of date error message (PR #128103)

2025-02-21 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/128103 >From d33995d72fd71c25da0505ca13610f0fd1f3398e Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Thu, 20 Feb 2025 17:23:24 -0800 Subject: [PATCH] [clang] Improve module out of date error message When a pcm

[clang] [clang] Improve module out of date error message (PR #128103)

2025-02-21 Thread Michael Spencer via cfe-commits
Bigcheese wrote: Fixed the missing test change. https://github.com/llvm/llvm-project/pull/128103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   >