Avoid unnecessary std::string copies. NFC.

llvm-svn: 271182
This commit is contained in:
Benjamin Kramer 2016-05-29 11:04:56 +00:00
parent 728f4448a9
commit 442b9a90a4
2 changed files with 3 additions and 3 deletions

View File

@ -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()) {

View File

@ -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);