replace useNeXTRuntimeAsDefault with a generic hook that allows targets
to specify their default language options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60561 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 2870c3d..bb838ed 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -497,6 +497,8 @@
// -fpascal-strings
static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
TargetInfo *Target) {
+ // Allow the target to set the default the langauge options as it sees fit.
+ Target->getDefaultLangOptions(Options);
if (Ansi) // "The -ansi option is equivalent to -std=c89."
LangStd = lang_c89;
@@ -574,13 +576,11 @@
Options.LaxVectorConversions = LaxVectorConversions;
Options.Exceptions = Exceptions;
- if (NeXTRuntime) {
+ // Override the default runtime if the user requested it.
+ if (NeXTRuntime)
Options.NeXTRuntime = 1;
- } else if (GNURuntime) {
+ else if (GNURuntime)
Options.NeXTRuntime = 0;
- } else {
- Options.NeXTRuntime = Target->useNeXTRuntimeAsDefault();
- }
}
static llvm::cl::opt<bool>
@@ -1524,8 +1524,8 @@
InitializeBaseLanguage();
LangKind LK = GetLanguage(InFile);
bool PCH = InitializeLangOptions(LangInfo, LK);
- InitializeLanguageStandard(LangInfo, LK, Target.get());
InitializeGCMode(LangInfo);
+ InitializeLanguageStandard(LangInfo, LK, Target.get());
// Process the -I options and set them in the HeaderInfo.
HeaderSearch HeaderInfo(FileMgr);