diff options
author | Yaron Keren <yaron.keren@gmail.com> | 2015-03-18 10:17:07 +0000 |
---|---|---|
committer | Yaron Keren <yaron.keren@gmail.com> | 2015-03-18 10:17:07 +0000 |
commit | 92e1b62d45aa5a3cbd67eaf5903165d7d8efeada (patch) | |
tree | 1444da86136cbaaadf6bf12dd03c51eda0f728a3 /clang/lib/Lex/Pragma.cpp | |
parent | 4a7baeab14a9f991752879bdc85ad4bf684cdf46 (diff) | |
download | bcm5719-llvm-92e1b62d45aa5a3cbd67eaf5903165d7d8efeada.tar.gz bcm5719-llvm-92e1b62d45aa5a3cbd67eaf5903165d7d8efeada.zip |
Remove many superfluous SmallString::str() calls.
Now that SmallString is a first-class citizen, most SmallString::str()
calls are not required. This patch removes a whole bunch of them, yet
there are lots more.
There are two use cases where str() is really needed:
1) To use one of StringRef member functions which is not available in
SmallString.
2) To convert to std::string, as StringRef implicitly converts while
SmallString do not. We may wish to change this, but it may introduce
ambiguity.
llvm-svn: 232622
Diffstat (limited to 'clang/lib/Lex/Pragma.cpp')
-rw-r--r-- | clang/lib/Lex/Pragma.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp index 0d9c508fd56..bfac3fda297 100644 --- a/clang/lib/Lex/Pragma.cpp +++ b/clang/lib/Lex/Pragma.cpp @@ -648,7 +648,7 @@ void Preprocessor::HandlePragmaIncludeAlias(Token &Tok) { SourceLocation End; if (ConcatenateIncludeName(FileNameBuffer, End)) return; // Diagnostic already emitted - SourceFileName = FileNameBuffer.str(); + SourceFileName = FileNameBuffer; } else { Diag(Tok, diag::warn_pragma_include_alias_expected_filename); return; @@ -679,7 +679,7 @@ void Preprocessor::HandlePragmaIncludeAlias(Token &Tok) { SourceLocation End; if (ConcatenateIncludeName(FileNameBuffer, End)) return; // Diagnostic already emitted - ReplaceFileName = FileNameBuffer.str(); + ReplaceFileName = FileNameBuffer; } else { Diag(Tok, diag::warn_pragma_include_alias_expected_filename); return; |