From 72bf4c6d99223e75aa9afd36d078ed0931fb6533 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 2 Mar 2021 13:02:04 +0100 Subject: [PATCH] [clang][cli] NFC: Use .str() instead of operator<< --- clang/lib/Frontend/CompilerInvocation.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) 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);