diff options
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 15 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 4 |
2 files changed, 10 insertions, 9 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 71a76a45ba5..635d566159b 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -1040,7 +1040,7 @@ bool ASTUnit::Parse(std::shared_ptr<PCHContainerOperations> PCHContainerOps, // Create the compiler instance to use for building the AST. std::unique_ptr<CompilerInstance> Clang( - new CompilerInstance(PCHContainerOps)); + new CompilerInstance(std::move(PCHContainerOps))); // Recover resources if we crash before exiting this method. llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance> @@ -1514,7 +1514,7 @@ ASTUnit::getMainBufferWithPrecompiledPreamble( // Create the compiler instance to use for building the precompiled preamble. std::unique_ptr<CompilerInstance> Clang( - new CompilerInstance(PCHContainerOps)); + new CompilerInstance(std::move(PCHContainerOps))); // Recover resources if we crash before exiting this method. llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance> @@ -1776,7 +1776,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction( // Create the compiler instance to use for building the AST. std::unique_ptr<CompilerInstance> Clang( - new CompilerInstance(PCHContainerOps)); + new CompilerInstance(std::move(PCHContainerOps))); // Recover resources if we crash before exiting this method. llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance> @@ -1896,7 +1896,7 @@ bool ASTUnit::LoadFromCompilerInvocation( llvm::CrashRecoveryContextCleanupRegistrar<llvm::MemoryBuffer> MemBufferCleanup(OverrideMainBuffer.get()); - return Parse(PCHContainerOps, std::move(OverrideMainBuffer)); + return Parse(std::move(PCHContainerOps), std::move(OverrideMainBuffer)); } std::unique_ptr<ASTUnit> ASTUnit::LoadFromCompilerInvocation( @@ -1929,7 +1929,7 @@ std::unique_ptr<ASTUnit> ASTUnit::LoadFromCompilerInvocation( llvm::CrashRecoveryContextReleaseRefCleanup<DiagnosticsEngine> > DiagCleanup(Diags.get()); - if (AST->LoadFromCompilerInvocation(PCHContainerOps, + if (AST->LoadFromCompilerInvocation(std::move(PCHContainerOps), PrecompilePreambleAfterNParses)) return nullptr; return AST; @@ -2012,7 +2012,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine( llvm::CrashRecoveryContextCleanupRegistrar<ASTUnit> ASTUnitCleanup(AST.get()); - if (AST->LoadFromCompilerInvocation(PCHContainerOps, + if (AST->LoadFromCompilerInvocation(std::move(PCHContainerOps), PrecompilePreambleAfterNParses)) { // Some error occurred, if caller wants to examine diagnostics, pass it the // ASTUnit. @@ -2062,7 +2062,8 @@ bool ASTUnit::Reparse(std::shared_ptr<PCHContainerOperations> PCHContainerOps, getDiagnostics().setNumWarnings(NumWarningsInPreamble); // Parse the sources - bool Result = Parse(PCHContainerOps, std::move(OverrideMainBuffer)); + bool Result = + Parse(std::move(PCHContainerOps), std::move(OverrideMainBuffer)); // If we're caching global code-completion results, and the top-level // declarations have changed, clear out the code-completion cache. diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 64f571e17a0..d89d933fe2c 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -127,7 +127,7 @@ IntrusiveRefCntPtr<ASTReader> CompilerInstance::getModuleManager() const { return ModuleManager; } void CompilerInstance::setModuleManager(IntrusiveRefCntPtr<ASTReader> Reader) { - ModuleManager = Reader; + ModuleManager = std::move(Reader); } std::shared_ptr<ModuleDependencyCollector> @@ -137,7 +137,7 @@ CompilerInstance::getModuleDepCollector() const { void CompilerInstance::setModuleDepCollector( std::shared_ptr<ModuleDependencyCollector> Collector) { - ModuleDepCollector = Collector; + ModuleDepCollector = std::move(Collector); } // Diagnostics |