Skip to content

Commit

Permalink
[Frontend] Use SmallString::operator std::string (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Jan 26, 2024
1 parent e0ade45 commit f0346a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion flang/lib/Frontend/CompilerInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static std::string getOutputFilePath(llvm::StringRef outputFilename,
if (!extension.empty() && (inputFilename != "-")) {
llvm::SmallString<128> path(inputFilename);
llvm::sys::path::replace_extension(path, extension);
outFile = std::string(path.str());
outFile = std::string(path);
}

return outFile;
Expand Down
8 changes: 4 additions & 4 deletions flang/lib/Frontend/TextDiagnosticBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ void TextDiagnosticBuffer::HandleDiagnostic(
llvm_unreachable("Diagnostic not handled during diagnostic buffering!");
case clang::DiagnosticsEngine::Note:
all.emplace_back(level, notes.size());
notes.emplace_back(info.getLocation(), std::string(buf.str()));
notes.emplace_back(info.getLocation(), std::string(buf));
break;
case clang::DiagnosticsEngine::Warning:
all.emplace_back(level, warnings.size());
warnings.emplace_back(info.getLocation(), std::string(buf.str()));
warnings.emplace_back(info.getLocation(), std::string(buf));
break;
case clang::DiagnosticsEngine::Remark:
all.emplace_back(level, remarks.size());
remarks.emplace_back(info.getLocation(), std::string(buf.str()));
remarks.emplace_back(info.getLocation(), std::string(buf));
break;
case clang::DiagnosticsEngine::Error:
case clang::DiagnosticsEngine::Fatal:
all.emplace_back(level, errors.size());
errors.emplace_back(info.getLocation(), std::string(buf.str()));
errors.emplace_back(info.getLocation(), std::string(buf));
break;
}
}
Expand Down

0 comments on commit f0346a5

Please sign in to comment.