Skip to content

[clang] Specialize invocation path visitation to the cow#205686

Merged
jansvoboda11 merged 4 commits into
llvm:mainfrom
jansvoboda11:invocation-copies-visitation
Jun 26, 2026
Merged

[clang] Specialize invocation path visitation to the cow#205686
jansvoboda11 merged 4 commits into
llvm:mainfrom
jansvoboda11:invocation-copies-visitation

Conversation

@jansvoboda11

@jansvoboda11 jansvoboda11 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

After #205632, the only clients of the compiler invocation's visitPaths() APIs call it on the cow variant. This PR moves the implementation from the base class into the cow, allowing specialized copy-on-write behavior for mutating visitation. If the callback requests a path to be mutated, exclusive ownership of the containing *Options instance is established and the string gets modified. This should be performance win for dependency scans using prefix mapping, although admittedly I haven't benchmarked.

@jansvoboda11

Copy link
Copy Markdown
Contributor Author

Depends on #205632.

@llvmorg-github-actions llvmorg-github-actions Bot added the clang Clang issues not falling into any other category label Jun 24, 2026
@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-clang

Author: Jan Svoboda (jansvoboda11)

Changes

After swiftlang#13201, the only clients of the compiler invocation's visitPaths() APIs call it on the cow variant. This PR moves the implementation from the base class into the cow, allowing specialized copy-on-write behavior for mutating visitation. If the callback requests a path to be mutated, exclusive ownership of the containing *Options instance is established and the string gets modified. This should be performance win for dependency scans using prefix mapping, although admittedly I haven't benchmarked.


Full diff: https://github.com/llvm/llvm-project/pull/205686.diff

7 Files Affected:

  • (modified) clang/include/clang/DependencyScanning/DependencyActionController.h (+1-1)
  • (modified) clang/include/clang/Frontend/CompilerInvocation.h (+88-14)
  • (modified) clang/include/clang/Frontend/FrontendOptions.h (+1-1)
  • (modified) clang/lib/DependencyScanning/DependencyScannerImpl.cpp (+10-2)
  • (modified) clang/lib/DependencyScanning/ModuleDepCollector.cpp (+2-2)
  • (modified) clang/lib/Frontend/CompilerInvocation.cpp (+51-49)
  • (modified) clang/lib/Tooling/DependencyScanningTool.cpp (+5-1)
diff --git a/clang/include/clang/DependencyScanning/DependencyActionController.h b/clang/include/clang/DependencyScanning/DependencyActionController.h
index 024b0de9048ec..023f080b767cc 100644
--- a/clang/include/clang/DependencyScanning/DependencyActionController.h
+++ b/clang/include/clang/DependencyScanning/DependencyActionController.h
@@ -61,7 +61,7 @@ class DependencyActionController {
   /// Finalizes the scan instance and modifies the resulting TU invocation.
   /// Returns true on success, false on failure.
   virtual bool finalize(CompilerInstance &ScanInstance,
-                        CompilerInvocation &NewInvocation) {
+                        CowCompilerInvocation &NewInvocation) {
     return true;
   }
 
diff --git a/clang/include/clang/Frontend/CompilerInvocation.h b/clang/include/clang/Frontend/CompilerInvocation.h
index 03097aefacf50..f71969d515be0 100644
--- a/clang/include/clang/Frontend/CompilerInvocation.h
+++ b/clang/include/clang/Frontend/CompilerInvocation.h
@@ -21,8 +21,10 @@
 #include "clang/Frontend/MigratorOptions.h"
 #include "clang/Frontend/PreprocessorOutputOptions.h"
 #include "clang/StaticAnalyzer/Core/AnalyzerOptions.h"
-#include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/ADT/ScopeExit.h"
+
 #include <memory>
 #include <string>
 
@@ -127,6 +129,9 @@ class CompilerInvocationBase {
   /// prevent creation of the reference-counted option objects.
   struct EmptyConstructor {};
 
+  /// Tag for the shallow-copy constructor below.
+  struct ShallowConstructor {};
+
   CompilerInvocationBase();
   CompilerInvocationBase(EmptyConstructor) {}
   CompilerInvocationBase(const CompilerInvocationBase &X) = delete;
@@ -160,13 +165,6 @@ class CompilerInvocationBase {
   const ssaf::SSAFOptions &getSSAFOpts() const { return *SSAFOpts; }
   /// @}
 
-  /// Visitation.
-  /// @{
-  /// Visits paths stored in the invocation. The callback may return true to
-  /// short-circuit the visitation, or return false to continue visiting.
-  void visitPaths(llvm::function_ref<bool(StringRef)> Callback) const;
-  /// @}
-
   /// Command line generation.
   /// @{
   using StringAllocator = llvm::function_ref<const char *(const Twine &)>;
@@ -201,12 +199,6 @@ class CompilerInvocationBase {
   /// This is a (less-efficient) wrapper over generateCC1CommandLine().
   std::vector<std::string> getCC1CommandLine() const;
 
-protected:
-  /// Visits paths stored in the invocation. This is generally unsafe to call
-  /// directly, and each sub-class need to ensure calling this doesn't violate
-  /// its invariants.
-  void visitPathsImpl(llvm::function_ref<bool(std::string &)> Predicate);
-
 private:
   /// Generate command line options from DiagnosticOptions.
   static void GenerateDiagnosticArgs(const DiagnosticOptions &Opts,
@@ -251,6 +243,15 @@ class CompilerInvocation : public CompilerInvocationBase {
   explicit CompilerInvocation(const CowCompilerInvocation &X);
   CompilerInvocation &operator=(const CowCompilerInvocation &X);
 
+  /// Move-construct/move-assign from a \c CowCompilerInvocation. Steals the
+  /// (potentially copy-on-written) option group pointers without deep-copying;
+  /// \p X is left empty. Useful to receive results of mutating a temporary
+  /// Cow alias back into a \c CompilerInvocation.
+  /// @{
+  explicit CompilerInvocation(CowCompilerInvocation &&X);
+  CompilerInvocation &operator=(CowCompilerInvocation &&X);
+  /// @}
+
   /// Const getters.
   /// @{
   // Note: These need to be pulled in manually. Otherwise, they get hidden by
@@ -293,6 +294,14 @@ class CompilerInvocation : public CompilerInvocationBase {
   ssaf::SSAFOptions &getSSAFOpts() { return *SSAFOpts; }
   /// @}
 
+  /// Invokes the \a Fn with CowCompilerInvocation representing \c this.
+  /// The \a Fn must not directly modify \c this.
+  /// The provided \c CowCompilerInvocation must not escape \a Fn.
+  template <class R>
+  R withCowRef(llvm::function_ref<R(CowCompilerInvocation &)> Fn);
+  template <class R>
+  R withCowRef(llvm::function_ref<R(const CowCompilerInvocation &)> Fn) const;
+
   /// Create a compiler invocation from a list of input options.
   /// \returns true on success.
   ///
@@ -385,6 +394,16 @@ class CowCompilerInvocation : public CompilerInvocationBase {
   CowCompilerInvocation(CompilerInvocation &&X)
       : CompilerInvocationBase(std::move(X)) {}
 
+  /// Construct a CowCompilerInvocation that aliases the option storage of \p
+  /// X without deep-copying. Subsequent mutations through getMut*Opts() will
+  /// copy-on-write per group as usual, leaving \p X unaffected. The caller
+  /// must guarantee that \p X is not mutated for the lifetime of the
+  /// constructed invocation.
+  CowCompilerInvocation(ShallowConstructor, const CompilerInvocation &X)
+      : CompilerInvocationBase(EmptyConstructor{}) {
+    shallow_copy_assign(X);
+  }
+
   // Const getters are inherited from the base class.
 
   /// Mutable getters.
@@ -404,8 +423,63 @@ class CowCompilerInvocation : public CompilerInvocationBase {
   PreprocessorOutputOptions &getMutPreprocessorOutputOpts();
   ssaf::SSAFOptions &getMutSSAFOpts();
   /// @}
+
+  /// The result of mutable visitation.
+  struct VisitMutResult {
+    /// Whether to replace the given StringRef with the modified std::string &.
+    bool Replace = false;
+    /// Whether to short-circuit the visitation.
+    bool Terminate = false;
+  };
+
+  /// Visits paths stored in the invocation, allowing the callback to mutate
+  /// them via the out-param. This upholds the same copy-on-write semantics as
+  /// the mutable getters.
+  void visitMutPaths(
+      llvm::function_ref<VisitMutResult(StringRef, std::string &)> Cb);
+
+  /// The result of const visitation.
+  struct VisitConstResult {
+    /// Whether to short-circuit the visitation.
+    bool Terminate = false;
+
+    operator VisitMutResult() const { return {/*Replace=*/false, Terminate}; }
+  };
+
+  /// Visits paths stored in the invocation.
+  void visitPaths(llvm::function_ref<VisitConstResult(StringRef)> Cb) const;
 };
 
+template <class R>
+R CompilerInvocation::withCowRef(
+    llvm::function_ref<R(CowCompilerInvocation &)> Fn) {
+  // We use moves to avoid bumping the ref-count of the shared_ptr that holds
+  // individual options. Since we expect \a Fn to actually modify \c CowRef,
+  // this prevents temporary copies.
+  CowCompilerInvocation CowRef = std::move(*this);
+  llvm::scope_exit Mutate([&]() { *this = std::move(CowRef); });
+  return Fn(CowRef);
+}
+
+template <class R>
+R CompilerInvocation::withCowRef(
+    llvm::function_ref<R(const CowCompilerInvocation &)> Fn) const {
+  // We use the shallow constructor. Since \a Fn cannot modify \c CowRef, no
+  // copies will be created, despite the bump to the ref-count of the shared_ptr
+  // that holds individual options.
+  CowCompilerInvocation CowRef(ShallowConstructor{}, *this);
+  return Fn(CowRef);
+}
+
+inline CompilerInvocation::CompilerInvocation(CowCompilerInvocation &&X)
+    : CompilerInvocationBase(std::move(X)) {}
+
+inline CompilerInvocation &
+CompilerInvocation::operator=(CowCompilerInvocation &&X) {
+  CompilerInvocationBase::operator=(std::move(X));
+  return *this;
+}
+
 IntrusiveRefCntPtr<llvm::vfs::FileSystem>
 createVFSFromCompilerInvocation(const CompilerInvocation &CI,
                                 DiagnosticsEngine &Diags);
diff --git a/clang/include/clang/Frontend/FrontendOptions.h b/clang/include/clang/Frontend/FrontendOptions.h
index a8627ea5d47a4..f65547e68b29d 100644
--- a/clang/include/clang/Frontend/FrontendOptions.h
+++ b/clang/include/clang/Frontend/FrontendOptions.h
@@ -241,7 +241,7 @@ class FrontendInputFile {
   /// Whether we're dealing with a 'system' input (vs. a 'user' input).
   bool IsSystem = false;
 
-  friend class CompilerInvocationBase;
+  friend class CowCompilerInvocation;
 
 public:
   FrontendInputFile() = default;
diff --git a/clang/lib/DependencyScanning/DependencyScannerImpl.cpp b/clang/lib/DependencyScanning/DependencyScannerImpl.cpp
index dc3dbe3603c01..68fda9227dfcb 100644
--- a/clang/lib/DependencyScanning/DependencyScannerImpl.cpp
+++ b/clang/lib/DependencyScanning/DependencyScannerImpl.cpp
@@ -713,7 +713,11 @@ bool DependencyScanningAction::runInvocation(
     if (MDC)
       MDC->applyDiscoveredDependencies(*OriginalInvocation);
 
-    if (!Controller.finalize(ScanInstance, *OriginalInvocation))
+    bool Success = OriginalInvocation->withCowRef<bool>(
+        [&](CowCompilerInvocation &CowOriginalInvocation) {
+          return Controller.finalize(ScanInstance, CowOriginalInvocation);
+        });
+    if (!Success)
       return false;
 
     Consumer.handleBuildCommand(
@@ -791,7 +795,11 @@ bool DependencyScanningAction::runInvocation(
       MDC->applyDiscoveredDependencies(*OriginalInvocation);
     }
 
-    if (!Controller.finalize(ScanInstance, *OriginalInvocation))
+    bool Success = OriginalInvocation->withCowRef<bool>(
+        [&](CowCompilerInvocation &CowOriginalInvocation) {
+          return Controller.finalize(ScanInstance, CowOriginalInvocation);
+        });
+    if (!Success)
       return false;
 
     Consumer.handleBuildCommand(
diff --git a/clang/lib/DependencyScanning/ModuleDepCollector.cpp b/clang/lib/DependencyScanning/ModuleDepCollector.cpp
index c4ca0a35f4c30..c7b7fcc8750c3 100644
--- a/clang/lib/DependencyScanning/ModuleDepCollector.cpp
+++ b/clang/lib/DependencyScanning/ModuleDepCollector.cpp
@@ -471,9 +471,9 @@ static bool isSafeToIgnoreCWD(const CowCompilerInvocation &CI) {
   // command line inputs use relative paths.
   bool AnyRelative = false;
   CI.visitPaths([&](StringRef Path) {
-    assert(!AnyRelative && "Continuing path visitation despite returning true");
+    assert(!AnyRelative && "Continuing path visitation despite relative path");
     AnyRelative |= !Path.empty() && !llvm::sys::path::is_absolute(Path);
-    return AnyRelative;
+    return CowCompilerInvocation::VisitConstResult{/*Terminate=*/AnyRelative};
   });
   return !AnyRelative;
 }
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index dfde7b756dbff..7da6a06ad2c73 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -5354,85 +5354,87 @@ std::string CompilerInvocation::computeContextHash() const {
   return toString(llvm::APInt(64, Hash), 36, /*Signed=*/false);
 }
 
-void CompilerInvocationBase::visitPathsImpl(
-    llvm::function_ref<bool(std::string &)> Predicate) {
-#define RETURN_IF(PATH)                                                        \
+void CowCompilerInvocation::visitMutPaths(
+    llvm::function_ref<VisitMutResult(StringRef, std::string &)> Cb) {
+  std::string NewValue;
+
+#define RETURN_IF(OPTS, PATH)                                                  \
   do {                                                                         \
-    if (Predicate(PATH))                                                       \
+    VisitMutResult Res = Cb(PATH, NewValue);                                   \
+    if (Res.Replace) {                                                         \
+      (void)ensureOwned(OPTS);                                                 \
+      PATH = "";                                                               \
+      std::swap(PATH, NewValue);                                               \
+    }                                                                          \
+    if (Res.Terminate)                                                         \
       return;                                                                  \
   } while (0)
 
-#define RETURN_IF_MANY(PATHS)                                                  \
+#define RETURN_IF_MANY(OPTS, PATHS)                                            \
   do {                                                                         \
-    if (llvm::any_of(PATHS, Predicate))                                        \
-      return;                                                                  \
+    for (unsigned I = 0, E = PATHS.size(); I != E; ++I)                        \
+      RETURN_IF(OPTS, PATHS[I]);                                               \
   } while (0)
 
-  auto &HeaderSearchOpts = *this->HSOpts;
   // Header search paths.
-  RETURN_IF(HeaderSearchOpts.Sysroot);
-  for (auto &Entry : HeaderSearchOpts.UserEntries)
+  RETURN_IF(HSOpts, HSOpts->Sysroot);
+  for (auto &Entry : HSOpts->UserEntries)
     if (Entry.IgnoreSysRoot)
-      RETURN_IF(Entry.Path);
-  RETURN_IF(HeaderSearchOpts.ResourceDir);
-  RETURN_IF(HeaderSearchOpts.ModuleCachePath);
-  RETURN_IF(HeaderSearchOpts.ModuleUserBuildPath);
-  for (auto &[Name, File] : HeaderSearchOpts.PrebuiltModuleFiles)
-    RETURN_IF(File);
-  RETURN_IF_MANY(HeaderSearchOpts.PrebuiltModulePaths);
-  RETURN_IF_MANY(HeaderSearchOpts.VFSOverlayFiles);
+      RETURN_IF(HSOpts, Entry.Path);
+  RETURN_IF(HSOpts, HSOpts->ResourceDir);
+  RETURN_IF(HSOpts, HSOpts->ModuleCachePath);
+  RETURN_IF(HSOpts, HSOpts->ModuleUserBuildPath);
+  for (auto &[Name, File] : HSOpts->PrebuiltModuleFiles)
+    RETURN_IF(HSOpts, File);
+  RETURN_IF_MANY(HSOpts, HSOpts->PrebuiltModulePaths);
+  RETURN_IF_MANY(HSOpts, HSOpts->VFSOverlayFiles);
 
   // Preprocessor options.
-  auto &PPOpts = *this->PPOpts;
-  RETURN_IF_MANY(PPOpts.MacroIncludes);
-  RETURN_IF_MANY(PPOpts.Includes);
-  RETURN_IF(PPOpts.ImplicitPCHInclude);
+  RETURN_IF_MANY(PPOpts, PPOpts->MacroIncludes);
+  RETURN_IF_MANY(PPOpts, PPOpts->Includes);
+  RETURN_IF(PPOpts, PPOpts->ImplicitPCHInclude);
 
   // Frontend options.
-  auto &FrontendOpts = *this->FrontendOpts;
-  for (auto &Input : FrontendOpts.Inputs) {
+  for (auto &Input : FrontendOpts->Inputs) {
     if (Input.isBuffer())
       continue;
 
-    RETURN_IF(Input.File);
+    RETURN_IF(FrontendOpts, Input.File);
   }
-  // TODO: Also report output files such as FrontendOpts.OutputFile;
-  RETURN_IF(FrontendOpts.CodeCompletionAt.FileName);
-  RETURN_IF_MANY(FrontendOpts.ModuleMapFiles);
-  RETURN_IF_MANY(FrontendOpts.ModuleFiles);
-  RETURN_IF_MANY(FrontendOpts.ModulesEmbedFiles);
-  RETURN_IF_MANY(FrontendOpts.ASTMergeFiles);
-  RETURN_IF(FrontendOpts.OverrideRecordLayoutsFile);
-  RETURN_IF(FrontendOpts.StatsFile);
+  // TODO: Also report output files such as FrontendOpts->OutputFile;
+  RETURN_IF(FrontendOpts, FrontendOpts->CodeCompletionAt.FileName);
+  RETURN_IF_MANY(FrontendOpts, FrontendOpts->ModuleMapFiles);
+  RETURN_IF_MANY(FrontendOpts, FrontendOpts->ModuleFiles);
+  RETURN_IF_MANY(FrontendOpts, FrontendOpts->ModulesEmbedFiles);
+  RETURN_IF_MANY(FrontendOpts, FrontendOpts->ASTMergeFiles);
+  RETURN_IF(FrontendOpts, FrontendOpts->OverrideRecordLayoutsFile);
+  RETURN_IF(FrontendOpts, FrontendOpts->StatsFile);
 
   // Filesystem options.
-  auto &FileSystemOpts = *this->FSOpts;
-  RETURN_IF(FileSystemOpts.WorkingDir);
+  RETURN_IF(FSOpts, FSOpts->WorkingDir);
 
   // Codegen options.
-  auto &CodeGenOpts = *this->CodeGenOpts;
-  RETURN_IF(CodeGenOpts.DebugCompilationDir);
-  RETURN_IF(CodeGenOpts.CoverageCompilationDir);
+  RETURN_IF(CodeGenOpts, CodeGenOpts->DebugCompilationDir);
+  RETURN_IF(CodeGenOpts, CodeGenOpts->CoverageCompilationDir);
 
   // Sanitizer options.
-  RETURN_IF_MANY(LangOpts->NoSanitizeFiles);
+  RETURN_IF_MANY(LangOpts, LangOpts->NoSanitizeFiles);
 
   // Coverage mappings.
-  RETURN_IF(CodeGenOpts.ProfileInstrumentUsePath);
-  RETURN_IF(CodeGenOpts.SampleProfileFile);
-  RETURN_IF(CodeGenOpts.ProfileRemappingFile);
+  RETURN_IF(CodeGenOpts, CodeGenOpts->ProfileInstrumentUsePath);
+  RETURN_IF(CodeGenOpts, CodeGenOpts->SampleProfileFile);
+  RETURN_IF(CodeGenOpts, CodeGenOpts->ProfileRemappingFile);
 
   // Dependency output options.
   for (auto &ExtraDep : DependencyOutputOpts->ExtraDeps)
-    RETURN_IF(ExtraDep.first);
+    RETURN_IF(DependencyOutputOpts, ExtraDep.first);
 }
 
-void CompilerInvocationBase::visitPaths(
-    llvm::function_ref<bool(StringRef)> Callback) const {
-  // The const_cast here is OK, because visitPathsImpl() itself doesn't modify
-  // the invocation, and our callback takes immutable StringRefs.
-  return const_cast<CompilerInvocationBase *>(this)->visitPathsImpl(
-      [&Callback](std::string &Path) { return Callback(StringRef(Path)); });
+void CowCompilerInvocation::visitPaths(
+    llvm::function_ref<VisitConstResult(StringRef)> Cb) const {
+  // The const_cast here is OK, because our callback never tries to modify.
+  return const_cast<CowCompilerInvocation *>(this)->visitMutPaths(
+      [&Cb](StringRef Path, std::string &) { return Cb(Path); });
 }
 
 void CompilerInvocationBase::generateCC1CommandLine(
diff --git a/clang/lib/Tooling/DependencyScanningTool.cpp b/clang/lib/Tooling/DependencyScanningTool.cpp
index d55367107862d..11b225830c2fc 100644
--- a/clang/lib/Tooling/DependencyScanningTool.cpp
+++ b/clang/lib/Tooling/DependencyScanningTool.cpp
@@ -587,7 +587,11 @@ bool CompilerInstanceWithContext::computeDependencies(
   MDC->run(Consumer);
   MDC->applyDiscoveredDependencies(ModuleInvocation);
 
-  if (!Controller.finalize(CI, ModuleInvocation))
+  bool Success = ModuleInvocation.withCowRef<bool>(
+      [&](CowCompilerInvocation &CowModuleInvocation) {
+        return Controller.finalize(CI, CowModuleInvocation);
+      });
+  if (!Success)
     return false;
 
   Consumer.handleBuildCommand(

@benlangmuir benlangmuir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to have a simple test that we get a copy of only the modified options object.

Comment thread clang/include/clang/Frontend/CompilerInvocation.h
Comment thread clang/lib/Frontend/CompilerInvocation.cpp Outdated
@jansvoboda11
jansvoboda11 force-pushed the invocation-copies-visitation branch from f5cc14d to 0d1ec78 Compare June 26, 2026 16:10
@jansvoboda11
jansvoboda11 requested a review from benlangmuir June 26, 2026 16:16
Comment thread clang/lib/Frontend/CompilerInvocation.cpp Outdated
Comment thread clang/include/clang/Frontend/CompilerInvocation.h
@jansvoboda11
jansvoboda11 force-pushed the invocation-copies-visitation branch from bf6672b to fafe2a8 Compare June 26, 2026 16:47
@jansvoboda11
jansvoboda11 requested a review from benlangmuir June 26, 2026 17:02
@jansvoboda11
jansvoboda11 merged commit 34d2a6d into llvm:main Jun 26, 2026
11 checks passed
@jansvoboda11
jansvoboda11 deleted the invocation-copies-visitation branch June 26, 2026 19:33
@llvm-ci

llvm-ci commented Jun 26, 2026

Copy link
Copy Markdown

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-runtime-2 running on rocm-worker-hw-02 while building clang at step 3 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/30810

Here is the relevant piece of the build log for the reference
Step 3 (annotate) failure: 'python ../llvm.src/offload/ci/openmp-offload-amdgpu-libc-runtime.py ...' (failure) (timed out)
...
[ 99%/0.847s :: 2->3->811 (of 815)] Linking CXX executable unittests/ADT/ADTTests
[ 99%/0.972s :: 2->2->812 (of 815)] Linking CXX executable unittests/Support/SupportTests
[ 99%/4.332s :: 2->1->813 (of 815)] Building CXX object unittests/ObjectYAML/CMakeFiles/ObjectYAMLTests.dir/DXContainerYAMLTest.cpp.o
[ 99%/4.427s :: 1->1->814 (of 815)] Linking CXX executable unittests/ObjectYAML/ObjectYAMLTests
[ 99%/4.427s :: 0->1->814 (of 815)] Running the LLVM regression tests
llvm-lit: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/utils/lit/lit/llvm/config.py:569: note: using ld.lld: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/ld.lld
llvm-lit: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/utils/lit/lit/llvm/config.py:569: note: using lld-link: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/lld-link
llvm-lit: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/utils/lit/lit/llvm/config.py:569: note: using ld64.lld: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/ld64.lld
llvm-lit: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/utils/lit/lit/llvm/config.py:569: note: using wasm-ld: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/wasm-ld
-- Testing: 68198 tests, 64 workers --
command timed out: 1200 seconds without output running [b'python', b'../llvm.src/offload/ci/openmp-offload-amdgpu-libc-runtime.py', b'--workdir=.'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=1604.310838
Step 10 (run check-llvm) failure: run check-llvm (failure)
...
[ 95%/0.516s :: 3->37->776 (of 815)] Linking CXX executable unittests/Object/ObjectTests
[ 95%/0.518s :: 3->36->777 (of 815)] Linking CXX executable unittests/MC/AMDGPU/AMDGPUMCTests
[ 95%/0.522s :: 3->35->778 (of 815)] Linking CXX executable unittests/TextAPI/TextAPITests
[ 95%/0.522s :: 3->34->779 (of 815)] Linking CXX executable unittests/DebugInfo/LogicalView/DebugInfoLogicalViewTests
[ 95%/0.532s :: 3->33->780 (of 815)] Building CXX object unittests/TableGen/CMakeFiles/TableGenTests.dir/AutomataTest.cpp.o
[ 95%/0.535s :: 2->33->781 (of 815)] Linking CXX executable unittests/CodeGen/GlobalISel/GlobalISelTests
[ 95%/0.547s :: 2->32->782 (of 815)] Linking CXX executable unittests/tools/llvm-profgen/LLVMProfgenTests
[ 96%/0.553s :: 2->31->783 (of 815)] Linking CXX executable unittests/MIR/MIRTests
[ 96%/0.553s :: 2->30->784 (of 815)] Linking CXX executable unittests/ProfileData/ProfileDataTests
[ 96%/0.558s :: 2->29->785 (of 815)] Linking CXX executable unittests/TargetParser/TargetParserTests
[ 96%/0.559s :: 2->28->786 (of 815)] Linking CXX executable unittests/DebugInfo/DWARF/DebugInfoDWARFTests
[ 96%/0.566s :: 2->27->787 (of 815)] Linking CXX executable unittests/tools/llvm-profdata/LLVMProfdataTests
[ 96%/0.568s :: 2->26->788 (of 815)] Linking CXX executable unittests/SandboxIR/SandboxIRTests
[ 96%/0.568s :: 2->25->789 (of 815)] Linking CXX executable unittests/Transforms/IPO/IPOTests
[ 96%/0.569s :: 2->24->790 (of 815)] Linking CXX executable unittests/Transforms/Coroutines/CoroTests
[ 97%/0.584s :: 2->23->791 (of 815)] Linking CXX executable unittests/XRay/XRayTests
[ 97%/0.585s :: 2->22->792 (of 815)] Linking CXX executable unittests/Target/TargetMachineCTests
[ 97%/0.597s :: 2->21->793 (of 815)] Linking CXX executable unittests/Transforms/Instrumentation/InstrumentationTests
[ 97%/0.598s :: 2->20->794 (of 815)] Linking CXX executable unittests/tools/llvm-cfi-verify/CFIVerifyTests
[ 97%/0.600s :: 2->19->795 (of 815)] Linking CXX executable unittests/TableGen/TableGenTests
[ 97%/0.600s :: 2->18->796 (of 815)] Linking CXX executable unittests/Transforms/Vectorize/VectorizeTests
[ 97%/0.607s :: 2->17->797 (of 815)] Linking CXX executable unittests/Transforms/Scalar/ScalarTests
[ 97%/0.615s :: 2->16->798 (of 815)] Linking CXX executable unittests/MI/MITests
[ 98%/0.620s :: 2->15->799 (of 815)] Linking CXX executable unittests/Analysis/AnalysisTests
[ 98%/0.628s :: 2->14->800 (of 815)] Linking CXX executable unittests/Target/SPIRV/SPIRVTests
[ 98%/0.631s :: 2->13->801 (of 815)] Linking CXX executable unittests/Target/X86/X86Tests
[ 98%/0.632s :: 2->12->802 (of 815)] Linking CXX executable unittests/tools/llvm-mca/LLVMMCATests
[ 98%/0.633s :: 2->11->803 (of 815)] Linking CXX executable unittests/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerTests
[ 98%/0.653s :: 2->10->804 (of 815)] Linking CXX executable unittests/CodeGen/CodeGenTests
[ 98%/0.658s :: 2->9->805 (of 815)] Linking CXX executable unittests/ExecutionEngine/Orc/OrcJITTests
[ 98%/0.691s :: 2->8->806 (of 815)] Linking CXX executable unittests/Target/AMDGPU/AMDGPUTests
[ 99%/0.700s :: 2->7->807 (of 815)] Linking CXX executable unittests/Transforms/Utils/UtilsTests
[ 99%/0.704s :: 2->6->808 (of 815)] Linking CXX executable unittests/tools/llvm-exegesis/LLVMExegesisTests
[ 99%/0.739s :: 2->5->809 (of 815)] Linking CXX executable unittests/Frontend/LLVMFrontendTests
[ 99%/0.759s :: 2->4->810 (of 815)] Linking CXX executable unittests/IR/IRTests
[ 99%/0.847s :: 2->3->811 (of 815)] Linking CXX executable unittests/ADT/ADTTests
[ 99%/0.972s :: 2->2->812 (of 815)] Linking CXX executable unittests/Support/SupportTests
[ 99%/4.332s :: 2->1->813 (of 815)] Building CXX object unittests/ObjectYAML/CMakeFiles/ObjectYAMLTests.dir/DXContainerYAMLTest.cpp.o
[ 99%/4.427s :: 1->1->814 (of 815)] Linking CXX executable unittests/ObjectYAML/ObjectYAMLTests
[ 99%/4.427s :: 0->1->814 (of 815)] Running the LLVM regression tests
llvm-lit: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/utils/lit/lit/llvm/config.py:569: note: using ld.lld: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/ld.lld
llvm-lit: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/utils/lit/lit/llvm/config.py:569: note: using lld-link: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/lld-link
llvm-lit: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/utils/lit/lit/llvm/config.py:569: note: using ld64.lld: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/ld64.lld
llvm-lit: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/utils/lit/lit/llvm/config.py:569: note: using wasm-ld: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/wasm-ld
-- Testing: 68198 tests, 64 workers --

command timed out: 1200 seconds without output running [b'python', b'../llvm.src/offload/ci/openmp-offload-amdgpu-libc-runtime.py', b'--workdir=.'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=1604.310838

@llvm-ci

llvm-ci commented Jun 26, 2026

Copy link
Copy Markdown

LLVM Buildbot has detected a new failure on builder clang-armv8-quick running on linaro-clang-armv8-quick while building clang at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/154/builds/33160

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: 1200 seconds without output running [b'ninja', b'check-all'], attempting to kill
...
[361/365] Building CXX object tools/clang/unittests/Interpreter/CMakeFiles/ClangReplInterpreterTests.dir/CodeCompletionTest.cpp.o
[362/365] Linking CXX executable tools/clang/unittests/Interpreter/ExceptionTests/ClangReplInterpreterExceptionTests
[363/365] Linking CXX executable tools/clang/unittests/Interpreter/ClangReplInterpreterTests
[364/365] Linking CXX executable tools/clang/unittests/AllClangUnitTests
[364/365] Running all regression tests
llvm-lit: /home/tcwg-buildbot/worker/clang-armv8-quick/llvm/llvm/utils/lit/lit/llvm/config.py:569: note: using split-file: /home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/split-file
llvm-lit: /home/tcwg-buildbot/worker/clang-armv8-quick/llvm/llvm/utils/lit/lit/llvm/config.py:569: note: using yaml2obj: /home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/yaml2obj
llvm-lit: /home/tcwg-buildbot/worker/clang-armv8-quick/llvm/llvm/utils/lit/lit/llvm/config.py:569: note: using llvm-objcopy: /home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/llvm-objcopy
llvm-lit: /home/tcwg-buildbot/worker/clang-armv8-quick/llvm/llvm/utils/lit/lit/llvm/config.py:569: note: using clang: /home/tcwg-buildbot/worker/clang-armv8-quick/stage1/bin/clang
-- Testing: 96015 of 96018 tests, 256 workers --
command timed out: 1200 seconds without output running [b'ninja', b'check-all'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=1899.524356

@llvm-ci

llvm-ci commented Jun 26, 2026

Copy link
Copy Markdown

LLVM Buildbot has detected a new failure on builder sanitizer-aarch64-linux-bootstrap-msan running on sanitizer-buildbot10 while building clang at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/94/builds/18803

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
-- Testing: 99814 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80..
FAIL: LLVM :: tools/obj2yaml/DXContainer/PRIVPart.yaml (88742 of 99814)
******************** TEST 'LLVM :: tools/obj2yaml/DXContainer/PRIVPart.yaml' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 5
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/yaml2obj /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/obj2yaml 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/yaml2obj /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/obj2yaml 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/yaml2obj /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml
# .---command stdout------------
# | DXBC��������������������U�������(���H���DXIL����`�������DXIL������������PRIV����ޭ��B
# `-----------------------------
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/obj2yaml
# .---command stdout------------
# | Error reading file: <stdin>: The file was not recognized as a valid object file
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/yaml2obj /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml
# note: command had no output on stdout or stderr
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/obj2yaml
# note: command had no output on stdout or stderr
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml
# note: command had no output on stdout or stderr

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Slowest Tests:
--------------------------------------------------------------------------
95.43s: LLVM :: CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
94.96s: LLVM :: CodeGen/AMDGPU/memintrinsic-unroll.ll
75.29s: LLVM :: tools/llvm-exegesis/AArch64/all-opcodes.test
73.05s: LLVM :: CodeGen/AMDGPU/sched-group-barrier-pipeline-solver.mir
69.81s: Clang :: ClangScanDeps/build-session-validation-outdated-module.c
69.42s: Clang :: CodeGen/X86/sse2-builtins.c
62.28s: Clang :: CodeGen/X86/avx-builtins.c
52.68s: Clang :: CodeGen/X86/xop-builtins.c
52.53s: Clang :: CodeGen/AArch64/sve-intrinsics/acle_sve_reinterpret.c
Step 11 (stage2/msan check) failure: stage2/msan check (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
-- Testing: 99814 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80..
FAIL: LLVM :: tools/obj2yaml/DXContainer/PRIVPart.yaml (88742 of 99814)
******************** TEST 'LLVM :: tools/obj2yaml/DXContainer/PRIVPart.yaml' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 5
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/yaml2obj /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/obj2yaml 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/yaml2obj /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/obj2yaml 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/yaml2obj /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml
# .---command stdout------------
# | DXBC��������������������U�������(���H���DXIL����`�������DXIL������������PRIV����ޭ��B
# `-----------------------------
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/obj2yaml
# .---command stdout------------
# | Error reading file: <stdin>: The file was not recognized as a valid object file
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/yaml2obj /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml
# note: command had no output on stdout or stderr
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/obj2yaml
# note: command had no output on stdout or stderr
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml
# note: command had no output on stdout or stderr

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Slowest Tests:
--------------------------------------------------------------------------
95.43s: LLVM :: CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
94.96s: LLVM :: CodeGen/AMDGPU/memintrinsic-unroll.ll
75.29s: LLVM :: tools/llvm-exegesis/AArch64/all-opcodes.test
73.05s: LLVM :: CodeGen/AMDGPU/sched-group-barrier-pipeline-solver.mir
69.81s: Clang :: ClangScanDeps/build-session-validation-outdated-module.c
69.42s: Clang :: CodeGen/X86/sse2-builtins.c
62.28s: Clang :: CodeGen/X86/avx-builtins.c
52.68s: Clang :: CodeGen/X86/xop-builtins.c
52.53s: Clang :: CodeGen/AArch64/sve-intrinsics/acle_sve_reinterpret.c

LouisLu060211 pushed a commit to LouisLu060211/llvm-project that referenced this pull request Jun 30, 2026
After llvm#205632, the only clients
of the compiler invocation's `visitPaths()` APIs call it on the cow
variant. This PR moves the implementation from the base class into the
cow, allowing specialized copy-on-write behavior for mutating
visitation. If the callback requests a path to be mutated, exclusive
ownership of the containing `*Options` instance is established and the
string gets modified. This should be performance win for dependency
scans using prefix mapping, although admittedly I haven't benchmarked.
maarcosrmz pushed a commit to maarcosrmz/llvm-project that referenced this pull request Jul 1, 2026
After llvm#205632, the only clients
of the compiler invocation's `visitPaths()` APIs call it on the cow
variant. This PR moves the implementation from the base class into the
cow, allowing specialized copy-on-write behavior for mutating
visitation. If the callback requests a path to be mutated, exclusive
ownership of the containing `*Options` instance is established and the
string gets modified. This should be performance win for dependency
scans using prefix mapping, although admittedly I haven't benchmarked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants