forked from OSchip/llvm-project
Avoid unnecessary std::string copies. NFC.
llvm-svn: 271182
This commit is contained in:
parent
728f4448a9
commit
442b9a90a4
|
@ -400,7 +400,7 @@ static void setPGOInstrumentor(CodeGenOptions &Opts, ArgList &Args,
|
|||
|
||||
// Set the profile kind using fprofile-instrument-use-path.
|
||||
static void setPGOUseInstrumentor(CodeGenOptions &Opts,
|
||||
const std::string ProfileName) {
|
||||
const Twine &ProfileName) {
|
||||
auto ReaderOrErr = llvm::IndexedInstrProfReader::create(ProfileName);
|
||||
// In error, return silently and let Clang PGOUse report the error message.
|
||||
if (auto E = ReaderOrErr.takeError()) {
|
||||
|
|
|
@ -70,8 +70,8 @@ bool formatAndApplyAllReplacements(const Replacements &Replaces,
|
|||
auto FileToReplaces = groupReplacementsByFile(Replaces);
|
||||
|
||||
bool Result = true;
|
||||
for (auto &FileAndReplaces : FileToReplaces) {
|
||||
const std::string FilePath = FileAndReplaces.first;
|
||||
for (const auto &FileAndReplaces : FileToReplaces) {
|
||||
const std::string &FilePath = FileAndReplaces.first;
|
||||
auto &CurReplaces = FileAndReplaces.second;
|
||||
|
||||
const FileEntry *Entry = Files.getFile(FilePath);
|
||||
|
|
Loading…
Reference in New Issue