]> granicus.if.org Git - clang/commitdiff
Avoid unnecessary std::string copies. NFC.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 29 May 2016 11:04:56 +0000 (11:04 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 29 May 2016 11:04:56 +0000 (11:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271182 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CompilerInvocation.cpp
lib/Tooling/Refactoring.cpp

index 4bb08c8a81c14ee106542e75f1b7bfdb4a8a3448..42ce6df1329ea7a46fa60109429fb8d9d99804e5 100644 (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()) {
index 3a1527558584790872176b84b4d769064703b968..51f0635c1ecbc0a6f3c950933e0b5545c4156dc2 100644 (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);