[clang] e4c32a4 - [Clang][NFC] Move Input into SmallVector instead of copy (#143830)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 12 14:31:03 PDT 2025


Author: Shafik Yaghmour
Date: 2025-06-12T14:30:59-07:00
New Revision: e4c32a4147012da735205eb44a45b8be5eea048d

URL: https://github.com/llvm/llvm-project/commit/e4c32a4147012da735205eb44a45b8be5eea048d
DIFF: https://github.com/llvm/llvm-project/commit/e4c32a4147012da735205eb44a45b8be5eea048d.diff

LOG: [Clang][NFC] Move Input into SmallVector instead of copy (#143830)

Static analysis flagged Input as a large object that would benefit from
being moved over being copied.

Added: 
    

Modified: 
    clang/lib/Frontend/CompilerInstance.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 587b0d1af9c8d..09a66b652518f 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -1191,7 +1191,7 @@ std::unique_ptr<CompilerInstance> CompilerInstance::cloneForModuleCompileImpl(
   FrontendOpts.OriginalModuleMap = std::string(OriginalModuleMapFile);
   // Force implicitly-built modules to hash the content of the module file.
   HSOpts.ModulesHashContent = true;
-  FrontendOpts.Inputs = {Input};
+  FrontendOpts.Inputs = {std::move(Input)};
 
   // Don't free the remapped file buffers; they are owned by our caller.
   PPOpts.RetainRemappedFileBuffers = true;


        


More information about the cfe-commits mailing list