Move -fms-extensions defaulting to driver, instead of using getDefaultLangOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89057 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 07c9e37..6c58d0d 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -995,11 +995,6 @@
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 @@
// 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/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index d5088fe..1eec2f2 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -889,7 +889,6 @@
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 @@
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 @@
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)) {