From: Jan Svoboda Date: Tue, 2 Mar 2021 12:02:04 +0000 (+0100) Subject: [clang][cli] NFC: Use .str() instead of operator<< X-Git-Tag: llvmorg-14-init~13660 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72bf4c6d99223e75aa9afd36d078ed0931fb6533;p=platform%2Fupstream%2Fllvm.git [clang][cli] NFC: Use .str() instead of operator<< --- diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index a3b4855..664b678 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);