aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorJOE1994 <joseph942010@gmail.com>2024-09-13 20:14:33 -0400
committerJOE1994 <joseph942010@gmail.com>2024-09-13 20:33:58 -0400
commit1b913cde2a4e3cf3b180edd0477a8e85f61886ce (patch)
tree2c3bd04d986c56c331bcccbe8c21fb6849a5a49e /clang/lib/CodeGen/CodeGenAction.cpp
parentd3cdf0f2220cb913092934d7bf08c89951d56f8d (diff)
downloadllvm-1b913cde2a4e3cf3b180edd0477a8e85f61886ce.zip
llvm-1b913cde2a4e3cf3b180edd0477a8e85f61886ce.tar.gz
llvm-1b913cde2a4e3cf3b180edd0477a8e85f61886ce.tar.bz2
[clang][CodeGen] Strip unneeded calls to raw_string_ostream::str() (NFC)
Try to avoid excess layer of indirection when possible. p.s. Remove a call to raw_string_ostream::flush() which is a no-op.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index e87226e..883333f 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -654,7 +654,7 @@ void BackendConsumer::UnsupportedDiagHandler(
auto DiagType = D.getSeverity() == llvm::DS_Error
? diag::err_fe_backend_unsupported
: diag::warn_fe_backend_unsupported;
- Diags.Report(Loc, DiagType) << MsgStream.str();
+ Diags.Report(Loc, DiagType) << Msg;
if (BadDebugInfo)
// If we were not able to translate the file:line:col information
@@ -691,9 +691,7 @@ void BackendConsumer::EmitOptimizationMessage(
if (D.getHotness())
MsgStream << " (hotness: " << *D.getHotness() << ")";
- Diags.Report(Loc, DiagID)
- << AddFlagValue(D.getPassName())
- << MsgStream.str();
+ Diags.Report(Loc, DiagID) << AddFlagValue(D.getPassName()) << Msg;
if (BadDebugInfo)
// If we were not able to translate the file:line:col information