[clang][cli] NFC: Use .str() instead of operator<<

This commit is contained in:
Jan Svoboda 2021-03-02 13:02:04 +01:00
parent de2b70010a
commit 72bf4c6d99
1 changed files with 6 additions and 16 deletions

View File

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