diff --git a/clang/include/clang/Driver/Options.def b/clang/include/clang/Driver/Options.def index d47b0e94e237..78f1ff6eadf9 100644 --- a/clang/include/clang/Driver/Options.def +++ b/clang/include/clang/Driver/Options.def @@ -430,6 +430,7 @@ OPTION("-fno-inline", fno_inline, Flag, clang_ignored_f_Group, INVALID, "", 0, 0 OPTION("-fno-keep-inline-functions", fno_keep_inline_functions, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-math-errno", fno_math_errno, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-merge-all-constants", fno_merge_all_constants, Flag, f_Group, INVALID, "", 0, 0, 0) +OPTION("-fno-ms-extensions", fno_ms_extensions, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-omit-frame-pointer", fno_omit_frame_pointer, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-pascal-strings", fno_pascal_strings, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-rtti", fno_rtti, Flag, f_Group, INVALID, "", 0, 0, 0) diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 07c9e37d1cf5..6c58d0dcb2d6 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -995,11 +995,6 @@ public: namespace { -/// GetWindowsVisualStudioLanguageOptions - Set the default language options for Windows. -static void GetWindowsVisualStudioLanguageOptions(LangOptions &Opts) { - Opts.Microsoft = true; -} - // x86-32 Windows Visual Studio target class VisualStudioWindowsX86_32TargetInfo : public WindowsX86_32TargetInfo { public: @@ -1014,10 +1009,6 @@ public: // We lost the original triple, so we use the default. Define(Defines, "_M_IX86", "600"); } - virtual void getDefaultLangOptions(LangOptions &Opts) { - WindowsX86_32TargetInfo::getDefaultLangOptions(Opts); - GetWindowsVisualStudioLanguageOptions(Opts); - } }; } // end anonymous namespace diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index d5088fe7b3f7..1eec2f288e6c 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -889,7 +889,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions); Args.AddLastArg(CmdArgs, options::OPT_fgnu_runtime); Args.AddLastArg(CmdArgs, options::OPT_flax_vector_conversions); - Args.AddLastArg(CmdArgs, options::OPT_fms_extensions); Args.AddLastArg(CmdArgs, options::OPT_fnext_runtime); Args.AddLastArg(CmdArgs, options::OPT_fno_caret_diagnostics); Args.AddLastArg(CmdArgs, options::OPT_fno_show_column); @@ -940,7 +939,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, else CmdArgs.push_back("-fexceptions=0"); - // -frtti is default, only pass non-default. + // -frtti is default. if (!Args.hasFlag(options::OPT_frtti, options::OPT_fno_rtti)) CmdArgs.push_back("-frtti=0"); @@ -950,6 +949,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, isSignedCharDefault(getToolChain().getTriple()))) CmdArgs.push_back("-fsigned-char=0"); + // -fms-extensions=0 is default. + if (Args.hasFlag(options::OPT_fms_extensions, + options::OPT_fno_ms_extensions, + getToolChain().getTriple().getOS() == llvm::Triple::Win32)) + CmdArgs.push_back("-fms-extensions"); + // -fshort-wchar default varies depending on platform; only // pass if specified. if (Arg *A = Args.getLastArg(options::OPT_fshort_wchar)) {