bool HasExplicitTemplateArgs,
TemplateArgumentListInfo TemplateArgs) {
return new (C, DC) ClassScopeFunctionSpecializationDecl(
- DC, Loc, FD, HasExplicitTemplateArgs, TemplateArgs);
+ DC, Loc, FD, HasExplicitTemplateArgs, std::move(TemplateArgs));
}
static ClassScopeFunctionSpecializationDecl *
void setCheckInputsExist(bool Value) { CheckInputsExist = Value; }
const std::string &getTitle() { return DriverTitle; }
- void setTitle(std::string Value) { DriverTitle = Value; }
+ void setTitle(std::string Value) { DriverTitle = std::move(Value); }
/// \brief Get the path to the main clang executable.
const char *getClangProgramPath() const {
/// \note Most clients should use setFileManager, which will implicitly reset
/// the virtual file system to the one contained in the file manager.
void setVirtualFileSystem(IntrusiveRefCntPtr<vfs::FileSystem> FS) {
- VirtualFileSystem = FS;
+ VirtualFileSystem = std::move(FS);
}
/// }
/// setPrefix - Set the diagnostic printer prefix string, which will be
/// printed at the start of any diagnostics. If empty, no prefix string is
/// used.
- void setPrefix(std::string Value) { Prefix = Value; }
+ void setPrefix(std::string Value) { Prefix = std::move(Value); }
void BeginSourceFile(const LangOptions &LO, const Preprocessor *PP) override;
void EndSourceFile() override;
void
ASTContext::setExternalSource(IntrusiveRefCntPtr<ExternalASTSource> Source) {
- ExternalSource = Source;
+ ExternalSource = std::move(Source);
}
void ASTContext::PrintStats() const {
// OverlayFileSystem implementation
//===-----------------------------------------------------------------------===/
OverlayFileSystem::OverlayFileSystem(IntrusiveRefCntPtr<FileSystem> BaseFS) {
- FSList.push_back(BaseFS);
+ FSList.push_back(std::move(BaseFS));
}
void OverlayFileSystem::pushOverlay(IntrusiveRefCntPtr<FileSystem> FS) {
RedirectingFileSystemParser P(Stream);
std::unique_ptr<RedirectingFileSystem> FS(
- new RedirectingFileSystem(ExternalFS));
+ new RedirectingFileSystem(std::move(ExternalFS)));
if (!YAMLFilePath.empty()) {
// Use the YAML path from -ivfsoverlay to compute the dir to be prefixed
void *DiagContext,
IntrusiveRefCntPtr<FileSystem> ExternalFS) {
return RedirectingFileSystem::create(std::move(Buffer), DiagHandler,
- YAMLFilePath, DiagContext, ExternalFS);
+ YAMLFilePath, DiagContext,
+ std::move(ExternalFS));
}
UniqueID vfs::getNextVirtualUniqueID() {
// 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>
// 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>
// 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>
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(
llvm::CrashRecoveryContextReleaseRefCleanup<DiagnosticsEngine> >
DiagCleanup(Diags.get());
- if (AST->LoadFromCompilerInvocation(PCHContainerOps,
+ if (AST->LoadFromCompilerInvocation(std::move(PCHContainerOps),
PrecompilePreambleAfterNParses))
return nullptr;
return AST;
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.
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.
return ModuleManager;
}
void CompilerInstance::setModuleManager(IntrusiveRefCntPtr<ASTReader> Reader) {
- ModuleManager = Reader;
+ ModuleManager = std::move(Reader);
}
std::shared_ptr<ModuleDependencyCollector>
void CompilerInstance::setModuleDepCollector(
std::shared_ptr<ModuleDependencyCollector> Collector) {
- ModuleDepCollector = Collector;
+ ModuleDepCollector = std::move(Collector);
}
// Diagnostics
const Twine &FileName,
std::shared_ptr<PCHContainerOperations> PCHContainerOps) {
return runToolOnCodeWithArgs(ToolAction, Code, std::vector<std::string>(),
- FileName, "clang-tool", PCHContainerOps);
+ FileName, "clang-tool",
+ std::move(PCHContainerOps));
}
static std::vector<std::string>
llvm::IntrusiveRefCntPtr<FileManager> Files(
new FileManager(FileSystemOptions(), OverlayFileSystem));
ToolInvocation Invocation(getSyntaxOnlyToolArgs(ToolName, Args, FileNameRef),
- ToolAction, Files.get(), PCHContainerOps);
+ ToolAction, Files.get(),
+ std::move(PCHContainerOps));
SmallString<1024> CodeStorage;
InMemoryFileSystem->addFile(FileNameRef, 0,
Input.release());
}
return runInvocation(BinaryName, Compilation.get(), Invocation.release(),
- PCHContainerOps);
+ std::move(PCHContainerOps));
}
bool ToolInvocation::runInvocation(
llvm::errs() << "\n";
}
- return Action->runInvocation(Invocation, Files, PCHContainerOps,
+ return Action->runInvocation(Invocation, Files, std::move(PCHContainerOps),
DiagConsumer);
}
std::shared_ptr<PCHContainerOperations> PCHContainerOps,
DiagnosticConsumer *DiagConsumer) {
// Create a compiler instance to handle the actual work.
- clang::CompilerInstance Compiler(PCHContainerOps);
+ clang::CompilerInstance Compiler(std::move(PCHContainerOps));
Compiler.setInvocation(Invocation);
Compiler.setFileManager(Files);
void ClangTool::appendArgumentsAdjuster(ArgumentsAdjuster Adjuster) {
if (ArgsAdjuster)
- ArgsAdjuster = combineAdjusters(ArgsAdjuster, Adjuster);
+ ArgsAdjuster =
+ combineAdjusters(std::move(ArgsAdjuster), std::move(Adjuster));
else
- ArgsAdjuster = Adjuster;
+ ArgsAdjuster = std::move(Adjuster);
}
void ClangTool::clearArgumentsAdjusters() {
std::shared_ptr<PCHContainerOperations> PCHContainerOps,
DiagnosticConsumer *DiagConsumer) override {
std::unique_ptr<ASTUnit> AST = ASTUnit::LoadFromCompilerInvocation(
- Invocation, PCHContainerOps,
+ Invocation, std::move(PCHContainerOps),
CompilerInstance::createDiagnostics(&Invocation->getDiagnosticOpts(),
DiagConsumer,
/*ShouldOwnClient=*/false),
buildASTFromCode(const Twine &Code, const Twine &FileName,
std::shared_ptr<PCHContainerOperations> PCHContainerOps) {
return buildASTFromCodeWithArgs(Code, std::vector<std::string>(), FileName,
- "clang-tool", PCHContainerOps);
+ "clang-tool", std::move(PCHContainerOps));
}
std::unique_ptr<ASTUnit> buildASTFromCodeWithArgs(
llvm::IntrusiveRefCntPtr<FileManager> Files(
new FileManager(FileSystemOptions(), OverlayFileSystem));
ToolInvocation Invocation(getSyntaxOnlyToolArgs(ToolName, Args, FileNameRef),
- &Action, Files.get(), PCHContainerOps);
+ &Action, Files.get(), std::move(PCHContainerOps));
SmallString<1024> CodeStorage;
InMemoryFileSystem->addFile(FileNameRef, 0,