Add TargetInfo::useNeXTRuntimeAsDefault

- Used to autoselect runtime when neither -fnext-runtime nor
   -fgnu-runtime is specified.
 - Default impl is false, all darwin targets set it to true.

llvm-svn: 55231
This commit is contained in:
Daniel Dunbar 2008-08-23 08:43:39 +00:00
parent 20abc419e5
commit b8767ac183
3 changed files with 15 additions and 6 deletions

View File

@ -387,7 +387,8 @@ NeXTRuntime("fnext-runtime",
// -trigraphs
// -fdollars-in-identifiers
// -fpascal-strings
static void InitializeLanguageStandard(LangOptions &Options, LangKind LK) {
static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
TargetInfo *Target) {
if (LangStd == lang_unspecified) {
// Based on the base language, pick one.
switch (LK) {
@ -454,8 +455,7 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK) {
} else if (GNURuntime) {
Options.NeXTRuntime = 0;
} else {
// FIXME: Should autoselect based on platform.
Options.NeXTRuntime = 0;
Options.NeXTRuntime = Target->useNeXTRuntimeAsDefault();
}
}
@ -1201,7 +1201,7 @@ int main(int argc, char **argv) {
InitializeBaseLanguage();
LangKind LK = GetLanguage(InFile);
InitializeLangOptions(LangInfo, LK);
InitializeLanguageStandard(LangInfo, LK);
InitializeLanguageStandard(LangInfo, LK, Target.get());
InitializeGCMode(LangInfo);
// Process the -I options and set them in the HeaderInfo.

View File

@ -206,8 +206,10 @@ public:
const char * const Register;
};
virtual bool useGlobalsForAutomaticVariables() const {return false;}
virtual bool useGlobalsForAutomaticVariables() const { return false; }
virtual bool useNeXTRuntimeAsDefault() const { return false; }
protected:
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const = 0;

View File

@ -501,6 +501,8 @@ public:
PPC32TargetInfo::getTargetDefines(Defines);
getDarwinDefines(Defines);
}
virtual bool useNeXTRuntimeAsDefault() const { return true; }
};
} // end anonymous namespace.
@ -512,6 +514,8 @@ public:
PPC64TargetInfo::getTargetDefines(Defines);
getDarwinDefines(Defines);
}
virtual bool useNeXTRuntimeAsDefault() const { return true; }
};
} // end anonymous namespace.
@ -656,6 +660,7 @@ public:
X86_32TargetInfo::getTargetDefines(Defines);
getDarwinDefines(Defines);
}
virtual bool useNeXTRuntimeAsDefault() const { return true; }
};
} // end anonymous namespace
@ -735,6 +740,8 @@ public:
X86_64TargetInfo::getTargetDefines(Defines);
getDarwinDefines(Defines);
}
virtual bool useNeXTRuntimeAsDefault() const { return true; }
};
} // end anonymous namespace.