[clang] 72bf4c6 - [clang][cli] NFC: Use .str() instead of operator<<
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 2 04:02:29 PST 2021
Author: Jan Svoboda
Date: 2021-03-02T13:02:04+01:00
New Revision: 72bf4c6d99223e75aa9afd36d078ed0931fb6533
URL: https://github.com/llvm/llvm-project/commit/72bf4c6d99223e75aa9afd36d078ed0931fb6533
DIFF: https://github.com/llvm/llvm-project/commit/72bf4c6d99223e75aa9afd36d078ed0931fb6533.diff
LOG: [clang][cli] NFC: Use .str() instead of operator<<
Added:
Modified:
clang/lib/Frontend/CompilerInvocation.cpp
Removed:
################################################################################
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index a3b4855ab54f..664b6783b1b3 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1466,19 +1466,12 @@ void CompilerInvocation::GenerateCodeGenArgs(
Args, Opts.EmulatedTLS ? OPT_femulated_tls : OPT_fno_emulated_tls, SA);
}
- if (Opts.FPDenormalMode != llvm::DenormalMode::getIEEE()) {
- std::string Buffer;
- llvm::raw_string_ostream OS(Buffer);
- Opts.FPDenormalMode.print(OS);
- GenerateArg(Args, OPT_fdenormal_fp_math_EQ, OS.str(), SA);
- }
+ if (Opts.FPDenormalMode != llvm::DenormalMode::getIEEE())
+ GenerateArg(Args, OPT_fdenormal_fp_math_EQ, Opts.FPDenormalMode.str(), SA);
- if (Opts.FP32DenormalMode != llvm::DenormalMode::getIEEE()) {
- std::string Buffer;
- llvm::raw_string_ostream OS(Buffer);
- Opts.FP32DenormalMode.print(OS);
- GenerateArg(Args, OPT_fdenormal_fp_math_f32_EQ, OS.str(), SA);
- }
+ if (Opts.FP32DenormalMode != llvm::DenormalMode::getIEEE())
+ GenerateArg(Args, OPT_fdenormal_fp_math_f32_EQ, Opts.FP32DenormalMode.str(),
+ SA);
if (Opts.StructReturnConvention == CodeGenOptions::SRCK_OnStack) {
OptSpecifier Opt =
@@ -3310,10 +3303,7 @@ void CompilerInvocation::GenerateLangArgs(const LangOptions &Opts,
// The '-fcf-protection=' option is generated by CodeGenOpts generator.
if (Opts.ObjC) {
- std::string Buffer;
- llvm::raw_string_ostream Stream(Buffer);
- Stream << Opts.ObjCRuntime;
- GenerateArg(Args, OPT_fobjc_runtime_EQ, Stream.str(), SA);
+ GenerateArg(Args, OPT_fobjc_runtime_EQ, Opts.ObjCRuntime.getAsString(), SA);
if (Opts.GC == LangOptions::GCOnly)
GenerateArg(Args, OPT_fobjc_gc_only, SA);
More information about the cfe-commits
mailing list