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);