[clang] [clang] Add explicit std::move(...) to avoid a few copies (PR #180478)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 11 08:43:27 PST 2026


================
@@ -1476,7 +1476,7 @@ ASTUnit::create(std::shared_ptr<CompilerInvocation> CI,
   ConfigureDiags(Diags, *AST, CaptureDiagnostics);
   IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS =
       createVFSFromCompilerInvocation(*CI, *Diags);
-  AST->DiagOpts = DiagOpts;
+  AST->DiagOpts = std::move(DiagOpts);
   AST->Diagnostics = Diags;
----------------
jansvoboda11 wrote:

While we're at it, we might as well move `Diags` I think.

https://github.com/llvm/llvm-project/pull/180478


More information about the cfe-commits mailing list