diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 510dc19f7a90..c8195f0f4ccf 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -3607,8 +3607,7 @@ static DwarfFissionKind getDebugFissionKind(const Driver &D, static void RenderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T, const ArgList &Args, - bool EmitCodeView, bool IsWindowsMSVC, - ArgStringList &CmdArgs, + bool EmitCodeView, ArgStringList &CmdArgs, codegenoptions::DebugInfoKind &DebugInfoKind, DwarfFissionKind &DwarfFission) { if (Args.hasFlag(options::OPT_fdebug_info_for_profiling, @@ -4651,8 +4650,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, AddClangCLArgs(Args, InputType, CmdArgs, &DebugInfoKind, &EmitCodeView); DwarfFissionKind DwarfFission; - RenderDebugOptions(TC, D, RawTriple, Args, EmitCodeView, IsWindowsMSVC, - CmdArgs, DebugInfoKind, DwarfFission); + RenderDebugOptions(TC, D, RawTriple, Args, EmitCodeView, CmdArgs, + DebugInfoKind, DwarfFission); // Add the split debug info name to the command lines here so we // can propagate it to the backend. @@ -5352,16 +5351,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, RawTriple.isOSDarwin() && !KernelOrKext)) CmdArgs.push_back("-fregister-global-dtors-with-atexit"); - // -fms-extensions=0 is default. - if (Args.hasFlag(options::OPT_fms_extensions, options::OPT_fno_ms_extensions, - IsWindowsMSVC)) - CmdArgs.push_back("-fms-extensions"); - // -fno-use-line-directives is default. if (Args.hasFlag(options::OPT_fuse_line_directives, options::OPT_fno_use_line_directives, false)) CmdArgs.push_back("-fuse-line-directives"); + // -fms-extensions=0 is default. + if (Args.hasFlag(options::OPT_fms_extensions, options::OPT_fno_ms_extensions, + IsWindowsMSVC)) + CmdArgs.push_back("-fms-extensions"); + // -fms-compatibility=0 is default. bool IsMSVCCompat = Args.hasFlag( options::OPT_fms_compatibility, options::OPT_fno_ms_compatibility,