[clang] c60ee7c - [clang][deps] Implement move-conversion for `CowCompilerInvocation` (#66301)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 13 15:51:27 PDT 2023
Author: Jan Svoboda
Date: 2023-09-13T15:51:24-07:00
New Revision: c60ee7c7b2154013e2b7b4f83ea422fbb4015cb7
URL: https://github.com/llvm/llvm-project/commit/c60ee7c7b2154013e2b7b4f83ea422fbb4015cb7
DIFF: https://github.com/llvm/llvm-project/commit/c60ee7c7b2154013e2b7b4f83ea422fbb4015cb7.diff
LOG: [clang][deps] Implement move-conversion for `CowCompilerInvocation` (#66301)
This avoids making copies at the end of
`makeCommonInvocationForModuleBuild()` (in `ModuleDepCollector.cpp`).
Added:
Modified:
clang/include/clang/Frontend/CompilerInvocation.h
Removed:
################################################################################
diff --git a/clang/include/clang/Frontend/CompilerInvocation.h b/clang/include/clang/Frontend/CompilerInvocation.h
index b79a1a53c150171..45e263e7bc76822 100644
--- a/clang/include/clang/Frontend/CompilerInvocation.h
+++ b/clang/include/clang/Frontend/CompilerInvocation.h
@@ -354,6 +354,9 @@ class CowCompilerInvocation : public CompilerInvocationBase {
deep_copy_assign(X);
}
+ CowCompilerInvocation(CompilerInvocation &&X)
+ : CompilerInvocationBase(std::move(X)) {}
+
// Const getters are inherited from the base class.
/// Mutable getters.
More information about the cfe-commits
mailing list