[clang] [compiler-rt] [llvm] Revert "Reapply "[ORC] Enable JIT support for the compact-unwind frame..." with fixes." (PR #125098)

2025-01-30 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: Failure looks unrelated. Merging. https://github.com/llvm/llvm-project/pull/125098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-01-30 Thread Ben Langmuir 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] [DependencyScanning] Add ability to scan TU with a buffer input (PR #125111)

2025-01-30 Thread Ben Langmuir 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] [DependencyScanning] Add ability to scan TU with a buffer input (PR #125111)

2025-02-04 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/125111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] Revert "Reapply "[ORC] Enable JIT support for the compact-unwind frame..." with fixes." (PR #125098)

2025-01-30 Thread Ben Langmuir via cfe-commits
-darwin.TestCases/Darwin/Generic.exceptions.cpp ORC-x86_64-darwin.TestCases/Darwin/x86-64.lljit-ehframe.cpp >From d2cf4b637cc667f2ccd094097828058524c90ec9 Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Thu, 30 Jan 2025 09:48:33 -0800 Subject: [PATCH] Revert "Reapply "[ORC] Enabl

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

2025-01-10 Thread Ben Langmuir 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-10 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir edited https://github.com/llvm/llvm-project/pull/119740 ___ 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-01-10 Thread Ben Langmuir 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-10 Thread Ben Langmuir 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-10 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir commented: 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 help

[clang] [clang][modules] Partially revert 48d0eb518 to fix -gmodules output (PR #124003)

2025-01-22 Thread Ben Langmuir via cfe-commits
-memory module cache rather than reading it from the pcm file that was written. This broke bootstrapping a build of clang with modules enabled on Darwin. rdar://143418834 >From 40879d967ff8b7463f3eb56d437cacde6e2689ef Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Wed, 22 Jan 2025 12:52

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-24 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: There's probably a better way, but I just built my first clang normally then built a second one with `-DCMAKE_C_COMPILER` and `-DCMAKE_CXX_COMPILER` pointing to the first one, and `-DLLVM_ENABLE_MODULES=1` to enable modules. https://github.com/llvm/llvm-project/pull/122726 _

[clang] [Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

2025-01-23 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: I see that this change has already been reverted by @ilya-biryukov , but FYI before this is re-applied: I am seeing crashes from this change if I attempt to bootstrap a build of clang with modules enabled on Darwin. I haven't yet managed to minimize a test case, but compili

[clang] [clang][modules] Fix local submodule visibility of macros from transitive import (PR #122955)

2025-01-14 Thread Ben Langmuir via cfe-commits
ether the submodules involved were explicitly defined (module X) or implicitly defined from an umbrella (module *). rdar://136524433 >From 5541ea0e31d35dfd20a3157a52997b1b2f6d3966 Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Tue, 14 Jan 2025 10:57:56 -0800 Subject: [PATCH] [clang][modu

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

2025-03-15 Thread Ben Langmuir via cfe-commits
@@ -248,39 +236,14 @@ LockFileManager::LockFileManager(StringRef FileName) // There is a lock file that nobody owns; try to clean it up and get // ownership. -if ((EC = sys::fs::remove(LockFileName))) { - std::string S("failed to remove lockfile "); - S.a

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

2025-03-19 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. 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][DependencyScanning] Track modules that resolve from sysroot. (PR #130634)

2025-03-14 Thread Ben Langmuir via cfe-commits
@@ -739,6 +748,12 @@ ModuleDepCollectorPP::handleTopLevelModule(const Module *M) { MDC.ScanInstance.getASTReader()->visitInputFileInfos( *MF, /*IncludeSystem=*/true, [&](const serialization::InputFileInfo &IFI, bool IsSystem) { +if (MD.IsInSysroot) { +

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

2025-03-14 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/131193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-03-14 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir 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] [clang][DependencyScanning] Track modules that resolve from "shared" locations (PR #130634)

2025-03-17 Thread Ben Langmuir via cfe-commits
@@ -739,6 +795,12 @@ ModuleDepCollectorPP::handleTopLevelModule(const Module *M) { MDC.ScanInstance.getASTReader()->visitInputFileInfos( *MF, /*IncludeSystem=*/true, [&](const serialization::InputFileInfo &IFI, bool IsSystem) { +if (MD.IsShareable) { +

[clang] [clang][DependencyScanning] Track modules that resolve from "shared" locations (PR #130634)

2025-03-17 Thread Ben Langmuir via cfe-commits
@@ -157,6 +157,32 @@ static void optimizeCWD(CowCompilerInvocation &BuildInvocation, StringRef CWD) { } } +/// Check a subset of invocation options to determine whether the current +/// context can safely be considered as shareable. +static bool areOptionsInSharedDir(CowCom

[clang] [clang][DependencyScanning] Track modules that resolve from "shared" locations (PR #130634)

2025-03-17 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. 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] [clang] Remove deprecated `FileManager` APIs (PR #132063)

2025-03-19 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir 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] Do not share ownership of `HeaderSearchOptions` (PR #132984)

2025-04-05 Thread Ben Langmuir via cfe-commits
@@ -48,7 +48,7 @@ void ASTMergeAction::ExecuteAction() { /*ShouldOwnClient=*/true)); std::unique_ptr Unit = ASTUnit::LoadFromASTFile( ASTFiles[I], CI.getPCHContainerReader(), ASTUnit::LoadEverything, Diags, -CI.getFileSys

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

2025-04-05 Thread Ben Langmuir via cfe-commits
@@ -116,7 +116,7 @@ class ASTUnit { std::shared_ptr PP; IntrusiveRefCntPtr Ctx; std::shared_ptr TargetOpts; - std::shared_ptrHSOpts; + std::unique_ptr HSOpts; benlangmuir wrote: Is there still a reason to keep this a poi

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

2025-03-28 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. Sounds great, thanks for explaining! https://github.com/llvm/llvm-project/pull/133467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

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

2025-03-28 Thread Ben Langmuir via cfe-commits
@@ -569,7 +569,7 @@ CrossTranslationUnitContext::ASTLoader::loadFromDump(StringRef ASTDumpPath) { return ASTUnit::LoadFromASTFile( ASTDumpPath, CI.getPCHContainerOperations()->getRawReader(), ASTUnit::LoadEverything, Diags, CI.getFileSystemOpts(), - CI.getHe

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

2025-03-28 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir edited https://github.com/llvm/llvm-project/pull/132984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-03-28 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir commented: Basically LGTM but there are two clients that I'm not familiar with. https://github.com/llvm/llvm-project/pull/132984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

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

2025-03-14 Thread Ben Langmuir via cfe-commits
@@ -0,0 +1,44 @@ +//===--===// +// +// 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][DependencyScanning] Track modules that resolve from sysroot. (PR #130634)

2025-03-14 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir commented: I have a similar concern to @jansvoboda11 that we probably need to check the invocation paths as well. > I would think that if ModuleDepCollector only found dependency inputs that > resolve to sysroot locations, the command line for building the spec

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

2025-03-14 Thread Ben Langmuir via cfe-commits
@@ -835,6 +850,13 @@ void ModuleDepCollectorPP::addAllSubmoduleDeps( }); } +void ModuleDepCollectorPP::addClangModule(const Module *M, const ModuleID ID, benlangmuir wrote: How about something like "addOneModuleDep"? If find it hard to guess from the name

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

2025-03-14 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir 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] [llvm] [Support] Return `LockFileManager` errors right away (PR #130627)

2025-03-15 Thread Ben Langmuir via cfe-commits
@@ -157,42 +157,35 @@ 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 o

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

2025-03-14 Thread Ben Langmuir via cfe-commits
@@ -739,6 +748,12 @@ ModuleDepCollectorPP::handleTopLevelModule(const Module *M) { MDC.ScanInstance.getASTReader()->visitInputFileInfos( *MF, /*IncludeSystem=*/true, [&](const serialization::InputFileInfo &IFI, bool IsSystem) { +if (MD.IsInSysroot) { +

[clang] [clang][frontend] Expose `CompilerInstance::cloneForModuleCompile()` (PR #135405)

2025-04-11 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/135405 ___ 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 Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. 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] Remove output file checks from `LockFileManager` (PR #130395)

2025-03-13 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. 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-commits

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

2025-03-05 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir closed 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] [clang][deps] Ensure DiagnosticConsumer::finish is always called (PR #127110)

2025-02-13 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir closed https://github.com/llvm/llvm-project/pull/127110 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Ensure DiagnosticConsumer::finish is always called (PR #127110)

2025-02-13 Thread Ben Langmuir via cfe-commits
, or if the command line contained no scannable actions we would fail to finish(), which would break some consumers (e.g. serialized diag consumer). >From c94b7df49f9b92b574c44fddc8b8faee1b7cdce0 Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Thu, 13 Feb 2025 10:50:09 -0800 Subject: [PA

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

2025-02-13 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir commented: There's another call to finish() in DependencyScanningWorker that should be removed if we do this. https://github.com/llvm/llvm-project/pull/100681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [clang][modules] Fix local submodule visibility of macros from transitive import (PR #122955)

2025-02-21 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir closed https://github.com/llvm/llvm-project/pull/122955 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Propagate the entire service (PR #128959)

2025-02-26 Thread Ben Langmuir via cfe-commits
@@ -130,11 +130,11 @@ class DependencyScanningWorker { DependencyActionController &Controller, StringRef ModuleName); - bool shouldEagerLoadModules() const { return EagerLoadModules; } - llvm::vfs::FileSys

[clang] [clang][deps] Propagate the entire service (PR #128959)

2025-02-26 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/128959 ___ 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-26 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/119740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Respect `Lexer::cutOffLexing()` (PR #134404)

2025-04-04 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/134404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-03-28 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: Are you planning to do the same for LangOpts and HSOpts? What's the ultimate goal here? There's also this comment on `CompilerInvocationBase`: ``` /// ... It keeps individual option objects /// behind reference-counted pointers, which is useful for clients that want to /// ke

[clang] [clang][deps] Avoid unchecked error assertion (PR #134284)

2025-04-03 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/134284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-13 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir edited https://github.com/llvm/llvm-project/pull/139751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-13 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. Nice find, thanks for fixing. https://github.com/llvm/llvm-project/pull/139751 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

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

2025-05-13 Thread Ben Langmuir via cfe-commits
@@ -0,0 +1,49 @@ +// This test checks that the module cache gets invalidated when the SDKSettings.json file changes. + +// RUN: rm -rf %t +// RUN: split-file %s %t + +//--- AppleTVOS15.0.sdk/SDKSettings-old.json +{ + "DisplayName": "tvOS 15.0", + "Version": "15.0", + "Canonica

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

2025-05-23 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: > I don't think we can ever get rid of that pattern and we will keep relying on > Clang supporting this. > We would need to example I shared above to keep working. > I think the change we want is to always prioritize modular over textual, > before we look at non-private vs p

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

2025-05-23 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: > I don't think we can ever get rid of that pattern and we will keep relying on > Clang supporting this. > We would need to example I shared above to keep working. I don't have a strong opinion on the best path forward here, but I'm not clear if you're actually willing to

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-18 Thread Ben Langmuir via cfe-commits
@@ -1259,6 +1259,7 @@ void ASTDeclWriter::VisitVarDecl(VarDecl *D) { VarDeclBits.addBit(D->isConstexpr()); VarDeclBits.addBit(D->isInitCapture()); VarDeclBits.addBit(D->isPreviousDeclInSameBlockScope()); +VarDeclBits.addBit(D->hasInitWithSideEffects());

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

2025-06-13 Thread Ben Langmuir via cfe-commits
@@ -1081,7 +1084,8 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { }; DependencyScanningService Service(ScanMode, Format, OptimizeArgs, -EagerLoadModules, /*TraceVFS=*/Verbose); +

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-16 Thread Ben Langmuir via cfe-commits
@@ -1442,6 +1442,10 @@ class ASTReader const StringRef &operator*() && = delete; }; + /// VarDecls with initializers containing side effects must be emitted, + /// but DeclMustBeEmitted is not allowed to deserialize the intializer. + llvm::SmallPtrSet InitSideEffectVa

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-16 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir edited https://github.com/llvm/llvm-project/pull/143739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-16 Thread Ben Langmuir via cfe-commits
@@ -2434,6 +2434,22 @@ VarDecl *VarDecl::getInitializingDeclaration() { return Def; } +bool VarDecl::hasInitWithSideEffects() const { + if (!hasInit()) +return false; + + if (auto *S = dyn_cast(Init)) { benlangmuir wrote: The original code in `getInit

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-16 Thread Ben Langmuir via cfe-commits
@@ -8310,8 +8310,6 @@ Stmt *ASTReader::GetExternalDeclStmt(uint64_t Offset) { Error(std::move(Err)); return nullptr; } - assert(NumCurrentElementsDeserializing == 0 && benlangmuir wrote: Can this assert come back now? https://github.com/llvm/llvm-p

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-16 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir commented: I think this new function should be called from `ASTContext::DeclMustBeEmitted`, no? https://github.com/llvm/llvm-project/pull/143739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-16 Thread Ben Langmuir via cfe-commits
@@ -1632,6 +1632,10 @@ RedeclarableResult ASTDeclReader::VisitVarDeclImpl(VarDecl *VD) { VD->NonParmVarDeclBits.PreviousDeclInSameBlockScope = VarDeclBits.getNextBit(); +bool hasInitWithSideEffect = VarDeclBits.getNextBit(); benlangmuir wrote:

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-23 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/143739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][modules] Serialize `CodeGenOptions` (PR #146422)

2025-07-01 Thread Ben Langmuir via cfe-commits
@@ -1181,8 +1183,9 @@ class Preprocessor { public: Preprocessor(const PreprocessorOptions &PPOpts, DiagnosticsEngine &diags, - const LangOptions &LangOpts, SourceManager &SM, - HeaderSearch &Headers, ModuleLoader &TheModuleLoader, +

[clang] [clang][scandeps] Improve handling of rawstrings. (PR #139504)

2025-06-26 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/139504 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][modules] Serialize `CodeGenOptions` (PR #146422)

2025-07-02 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: > Would you have a different opinion if I told you that the next PR in my > queue re-introduces AFFECTING_*_CODEGENOPT to represent the affecting > ENUM_LANGOPT(ExceptionHandling, ...? I think it helps a bit, but the core problem is that we don't have `BENIGN_CODEGENOPT`.

[clang] [clang-tools-extra] [clang][modules] Serialize `CodeGenOptions` (PR #146422)

2025-07-02 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: > Ok, so what do you suggest? Change all CODEGENOPT to BENIGN_CODEGENOPT before > this PR lands? This would be fine with me. > (Or alternatively/equivalently go all the way and add an explicit benign > effect on AST argument to CODEGENOPT, similar to what I linked above for

[clang] [clang-tools-extra] [lldb] [llvm] [clang][modules] Serialize `CodeGenOptions` (PR #146422)

2025-07-15 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/146422 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D47273: [bash-completion] Fix tab separation on macOS

2018-05-23 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir created this revision. benlangmuir added reviewers: yamaguchi, v.g.vassilev, ruiu, teemperor. Herald added a subscriber: cfe-commits. We have a regex that needs to match a tab character in the command output, but on macOS `sed` doesn't support '\t', causing it to split on the 't' char

[PATCH] D47273: [bash-completion] Fix tab separation on macOS

2018-05-23 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. In https://reviews.llvm.org/D47273#1109934, @ruiu wrote: > I wonder if you could replace \t with \0x09. At least it works on my machine > which has GNU sed. Unfortunately that doesn't work either on mac :-\ Repository: rC Clang https://reviews.llvm.org/D47273

[PATCH] D47273: [bash-completion] Fix tab separation on macOS

2018-05-23 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. In https://reviews.llvm.org/D47273#1109985, @ruiu wrote: > sed -e "$(echo -e 's/\t.*//')" Yep, that works! Is there a reason you prefer that over the more succinct `$'s/\t.*//'`? Repository: rC Clang https://reviews.llvm.org/D47273 __

[PATCH] D47273: [bash-completion] Fix tab separation on macOS

2018-05-23 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir updated this revision to Diff 148278. benlangmuir edited the summary of this revision. benlangmuir added a comment. Thanks for looking up the supported bash version! Updated diff. https://reviews.llvm.org/D47273 Files: utils/bash-autocomplete.sh Index: utils/bash-autocomplete.

[PATCH] D47273: [bash-completion] Fix tab separation on macOS

2018-05-24 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir closed this revision. benlangmuir added a comment. r333202 https://reviews.llvm.org/D47273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D34256: [PR33394] Avoid lexing editor placeholders when running the preprocessor only

2017-06-15 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. I agree with not detecting these during PP-only, but there's nothing wrong with `<#>`. It's either not a placeholder, or it's part of a placeholder like `<#>#>`, which is a placeholder containing the text ">". Similarly, `<##` could be the start of an empty placeh

[PATCH] D34256: [PR33394] Avoid lexing editor placeholders when running the preprocessor only

2017-06-16 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir accepted this revision. benlangmuir added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rL LLVM https://reviews.llvm.org/D34256 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lis

[PATCH] D34263: [preprocessor] When preprocessor option 'SingleFileParseMode' is enabled, parse all directive blocks if the condition uses undefined macros

2017-06-16 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. It would be nice if the doc comment for the single file parse mode flag was updated to include this new functionality. Comment at: lib/Lex/PPDirectives.cpp:2709 +CurPPLexer->pushConditionalLevel(IfToken.getLocation(), /*wasskip*/true, +

[PATCH] D34263: [preprocessor] When preprocessor option 'SingleFileParseMode' is enabled, parse all directive blocks if the condition uses undefined macros

2017-06-16 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added inline comments. Comment at: lib/Lex/PPDirectives.cpp:2774 +// the directive blocks. +CurPPLexer->pushConditionalLevel(CI.IfLoc, /*wasskip*/false, + /*foundnonskip*/true, /*foundelse*/true); akyrtzi wrot

[PATCH] D34263: [preprocessor] When preprocessor option 'SingleFileParseMode' is enabled, parse all directive blocks if the condition uses undefined macros

2017-06-16 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. Thanks, this looks good to me. I'd appreciate if @klimek could take a quick look though. Comment at: include/clang/Lex/PreprocessorOptions.h:102 + /// in preprocessor directive conditions it causes all blocks to be parsed so + /// that the clien

[PATCH] D41526: [libclang] Avoid builtin trap for __debug parser_crash pragma

2017-12-21 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. Did you consider just using a different pragma that triggers this behaviour instead of avoiding the crash? I don't really have a strong preference but I'd be interested to hear what you think the pros/cons are. Comment at: lib/Parse/ParseDecl.cpp

[PATCH] D44652: [vfs] Don't bail out after a missing -ivfsoverlay file

2018-03-19 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir created this revision. benlangmuir added reviewers: bruno, vsapsai. Herald added a subscriber: cfe-commits. This make -ivfsoverlay behave more like other fatal errors (e.g. missing -include file) by skipping the missing file instead of bailing out of the whole compilation. This makes i

[PATCH] D54529: [clangd] Add USR to textDocument/definition response

2018-11-14 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. @sammccall RE using USRs: we want to integrate clangd into a larger source tooling system that is already using USRs extensively to identify symbols. The most obvious case is that we have an index outside of clangd that uses USRs from clang-the-compiler, so exposing

[PATCH] D58924: Replace clang::FileData with llvm::vfs::Status

2019-03-04 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir accepted this revision. benlangmuir added a comment. This revision is now accepted and ready to land. LGTM, although I made a small suggestion for clarity. FYI `InPCH` was used by PTH, which was removed a couple of months ago. Comment at: clang/lib/Basic/FileManag

[PATCH] D58924: Replace clang::FileData with llvm::vfs::Status

2019-03-04 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added inline comments. Comment at: clang/lib/Basic/FileManager.cpp:305 +UFE = &UniqueRealFiles[Status.getUniqueID()]; +Status = llvm::vfs::Status( + Status.getName(), Status.getUniqueID(), harlanhaskins wrote: > benlangmuir wrote: > > Why

[PATCH] D60735: [FileSystemStatCache] Return std::error_code from stat cache methods

2019-04-15 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. LGTM, but I'd appreciate someone who has worked on this more recently taking a look. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60735/new/ https://reviews.llvm.org/D60735 _

[PATCH] D57965: Clean up ObjCPropertyDecl printing

2019-02-12 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added subscribers: akyrtzi, benlangmuir. benlangmuir added a comment. @arphaman @akyrtzi could you take a look at this? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57965/new/ https://reviews.llvm.org/D57965 ___

[PATCH] D57965: Clean up ObjCPropertyDecl printing

2019-02-12 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. > @property(attr, attr2) instead of @property ( attr,attr2 ). The style I see most often is `@property (attr, attr2)`, which is in between those two. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57965/new/ https://reviews.llvm.org/

[PATCH] D34512: Add preliminary Cross Translation Unit support library

2017-08-30 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. In https://reviews.llvm.org/D34512#856301, @xazax.hun wrote: > In https://reviews.llvm.org/D34512#856184, @dcoughlin wrote: > > > In either case, the important scenario I think we should support is > > choosing at a call site to a C function the most likely definitio

[PATCH] D48685: [PCH+Modules] Load -fmodule-map-file content before including PCHs

2018-07-09 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir accepted this revision. benlangmuir added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D48685 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/list

[PATCH] D132405: [clang][deps] Split translation units into individual -cc1 or other commands

2022-08-30 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir marked 2 inline comments as done. benlangmuir added inline comments. Comment at: clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp:295 +if (MDC) + MDC->applyDiscoveredDependencies(CI); +LastCC1Arguments = CI.getCC1CommandLine(); -

[PATCH] D132405: [clang][deps] Split translation units into individual -cc1 or other commands

2022-08-30 Thread Ben Langmuir via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGf80a0ea76072: [clang][deps] Split translation units into individual -cc1 or other commands (authored by benlangmuir). Repository: rG LLVM Github M

[PATCH] D133357: [Lex/DependencyDirectivesScanner] Keep track of the presence of tokens between the last scanned directive and EOF

2022-09-06 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added inline comments. Comment at: clang/include/clang/Lex/DependencyDirectivesScanner.h:131 +/// \p dependency_directives_scan::tokens_present_before_eof, otherwise this +/// directive will be ignored. /// Why would you want to print without this? I

[PATCH] D133357: [Lex/DependencyDirectivesScanner] Keep track of the presence of tokens between the last scanned directive and EOF

2022-09-06 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added inline comments. Comment at: clang/include/clang/Lex/DependencyDirectivesScanner.h:131 +/// \p dependency_directives_scan::tokens_present_before_eof, otherwise this +/// directive will be ignored. /// akyrtzi wrote: > benlangmuir wrote: > > Why

[PATCH] D133357: [Lex/DependencyDirectivesScanner] Keep track of the presence of tokens between the last scanned directive and EOF

2022-09-06 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added inline comments. Comment at: clang/include/clang/Lex/DependencyDirectivesScanner.h:131 +/// \p dependency_directives_scan::tokens_present_before_eof, otherwise this +/// directive will be ignored. /// benlangmuir wrote: > akyrtzi wrote: > > ben

[PATCH] D133357: [Lex/DependencyDirectivesScanner] Keep track of the presence of tokens between the last scanned directive and EOF

2022-09-07 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir accepted this revision. benlangmuir added a comment. This revision is now accepted and ready to land. You forgot to remove the ` \param PrintMarkerForTokensBeforeEOF ...` from the doc comment. Otherwise LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:

[PATCH] D133611: [clang] sort additional module maps when serializing

2022-09-09 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir accepted this revision. benlangmuir added a comment. This revision is now accepted and ready to land. Good catch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133611/new/ https://reviews.llvm.org/D133611 __

[PATCH] D133617: [Clang][ScanDeps] Change multiple-commands.c test to use -fmodules-cache-path on implicit builds

2022-09-09 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir accepted this revision. benlangmuir added a comment. This revision is now accepted and ready to land. Thanks for catching this! Comment at: clang/test/ClangScanDeps/multiple-commands.c:11 // RUN: split-file %s %t -// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.in > %t/cd

[PATCH] D133622: [clang][test] Disallow using the default module cache path in lit tests

2022-09-09 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir created this revision. benlangmuir added reviewers: bruno, jansvoboda11, arphaman. Herald added a subscriber: delcypher. Herald added a project: All. benlangmuir requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits.

[PATCH] D133617: [Clang][ScanDeps] Change multiple-commands.c test to use -fmodules-cache-path on implicit builds

2022-09-09 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. Attempting to not do this again: https://reviews.llvm.org/D133622 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133617/new/ https://reviews.llvm.org/D133617 ___ cfe-commits m

[PATCH] D133622: [clang][test] Disallow using the default module cache path in lit tests

2022-09-12 Thread Ben Langmuir via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd96f526196ac: [clang][test] Disallow using the default module cache path in lit tests (authored by benlangmuir). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D133622: [clang][test] Disallow using the default module cache path in lit tests

2022-09-12 Thread Ben Langmuir via Phabricator via cfe-commits
benlangmuir added a comment. Reverted due to failure on a bot https://lab.llvm.org/buildbot/#/builders/214/builds/3252 I'm not sure how to deal with missing `env -u`. - We could do `env CLANG_MODULE_CACHE_PATH=` and change the compiler's interpretation of empty string for this variable. I'm no

<    1   2   3   4   5   6   7   8   9   >