From: Reid Kleckner Date: Tue, 14 Feb 2017 18:38:40 +0000 (+0000) Subject: Remove unnecessary std::string construction X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae1e111d1122cf5b10e9cd8876bb47551d4f89f9;p=clang Remove unnecessary std::string construction git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295083 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 322c5809cd..811f7ff954 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -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); } }