]> granicus.if.org Git - clang/commitdiff
Remove unnecessary std::string construction
authorReid Kleckner <rnk@google.com>
Tue, 14 Feb 2017 18:38:40 +0000 (18:38 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 14 Feb 2017 18:38:40 +0000 (18:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295083 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPDirectives.cpp

index 322c5809cd2c7b36498b8663c7fc56d2e3c6f86d..811f7ff9542ba526d2e388a14c0f5178049fda3a 100644 (file)
@@ -1983,14 +1983,13 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
           Path.size() <= Filename.size() ? Filename[Path.size()-1] :
             (isAngled ? '>' : '"'));
       }
-      auto Replacement = Path.str().str();
       // For user files and known standard headers, by default we issue a diagnostic.
       // For other system headers, we don't. They can be controlled separately.
       auto DiagId = (FileCharacter == SrcMgr::C_User || warnByDefaultOnWrongCase(Name)) ?
           diag::pp_nonportable_path : diag::pp_nonportable_system_path;
       SourceRange Range(FilenameTok.getLocation(), CharEnd);
-      Diag(FilenameTok, DiagId) << Replacement <<
-        FixItHint::CreateReplacement(Range, Replacement);
+      Diag(FilenameTok, DiagId) << Path <<
+        FixItHint::CreateReplacement(Range, Path);
     }
   }