Index: include/clang/Lex/HeaderSearchOptions.h =================================================================== --- include/clang/Lex/HeaderSearchOptions.h +++ include/clang/Lex/HeaderSearchOptions.h @@ -203,34 +203,35 @@ unsigned ModulesHashContent : 1; - HeaderSearchOptions(StringRef _Sysroot = "/") - : Sysroot(_Sysroot), ModuleFormat("raw"), DisableModuleHash(false), - ImplicitModuleMaps(false), ModuleMapFileHomeIsCwd(false), - UseBuiltinIncludes(true), UseStandardSystemIncludes(true), - UseStandardCXXIncludes(true), UseLibcxx(false), Verbose(false), + HeaderSearchOptions(std::string _Sysroot = "/") + : Sysroot(std::move(_Sysroot)), ModuleFormat("raw"), + DisableModuleHash(false), ImplicitModuleMaps(false), + ModuleMapFileHomeIsCwd(false), UseBuiltinIncludes(true), + UseStandardSystemIncludes(true), UseStandardCXXIncludes(true), + UseLibcxx(false), Verbose(false), ModulesValidateOncePerBuildSession(false), ModulesValidateSystemHeaders(false), UseDebugInfo(false), ModulesValidateDiagnosticOptions(true), ModulesHashContent(false) {} /// AddPath - Add the \p Path path to the specified \p Group list. - void AddPath(StringRef Path, frontend::IncludeDirGroup Group, + void AddPath(std::string Path, frontend::IncludeDirGroup Group, bool IsFramework, bool IgnoreSysRoot) { - UserEntries.emplace_back(Path, Group, IsFramework, IgnoreSysRoot); + UserEntries.emplace_back(std::move(Path), Group, IsFramework, IgnoreSysRoot); } /// AddSystemHeaderPrefix - Override whether \#include directives naming a /// path starting with \p Prefix should be considered as naming a system /// header. - void AddSystemHeaderPrefix(StringRef Prefix, bool IsSystemHeader) { - SystemHeaderPrefixes.emplace_back(Prefix, IsSystemHeader); + void AddSystemHeaderPrefix(std::string Prefix, bool IsSystemHeader) { + SystemHeaderPrefixes.emplace_back(std::move(Prefix), IsSystemHeader); } - void AddVFSOverlayFile(StringRef Name) { - VFSOverlayFiles.push_back(Name); + void AddVFSOverlayFile(std::string Name) { + VFSOverlayFiles.emplace_back(std::move(Name)); } - void AddPrebuiltModulePath(StringRef Name) { - PrebuiltModulePaths.push_back(Name); + void AddPrebuiltModulePath(std::string Name) { + PrebuiltModulePaths.emplace_back(std::move(Name)); } };