From: Daniel Dunbar Date: Tue, 17 Nov 2009 09:15:44 +0000 (+0000) Subject: Eliminate TargetInfo::getDefaultLangOptions, this kind of logic is better done X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2fc430d5483545b47a5a22f45338ff54f5362e34;p=clang Eliminate TargetInfo::getDefaultLangOptions, this kind of logic is better done in the driver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89073 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index d2f7399b70..695f51d2c4 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -342,11 +342,6 @@ public: return ""; } - /// getDefaultLangOptions - Allow the target to specify default settings for - /// various language options. These may be overridden by command line - /// options. - virtual void getDefaultLangOptions(LangOptions &Opts) {} - /// setForcedLangOptions - Set forced language options. /// Apply changes to the target information with respect to certain /// language options which change the target configuration. diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 3a4d115db2..07c2bb960b 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -155,24 +155,6 @@ static void getDarwinIPhoneOSDefines(std::vector &Defs, iPhoneOSStr); } -/// GetDarwinLanguageOptions - Set the default language options for darwin. -static void GetDarwinLanguageOptions(LangOptions &Opts, - const llvm::Triple &Triple) { - unsigned MajorVersion = Triple.getDarwinMajorNumber(); - - // Blocks and stack protectors default to on for 10.6 (darwin10) and beyond. - if (MajorVersion > 9) { - Opts.Blocks = 1; - Opts.setStackProtectorMode(LangOptions::SSPOn); - } - - // Non-fragile ABI (in 64-bit mode) default to on for 10.5 (darwin9) and - // beyond. - if (MajorVersion >= 9 && Opts.ObjC1 && - Triple.getArch() == llvm::Triple::x86_64) - Opts.ObjCNonFragileABI = 1; -} - namespace { template class DarwinTargetInfo : public OSTargetInfo { @@ -183,12 +165,6 @@ protected: getDarwinOSXDefines(Defines, Triple); } - /// getDefaultLangOptions - Allow the target to specify default settings for - /// various language options. These may be overridden by command line - /// options. - virtual void getDefaultLangOptions(LangOptions &Opts) { - GetDarwinLanguageOptions(Opts, TargetInfo::getTriple()); - } public: DarwinTargetInfo(const std::string& triple) : OSTargetInfo(triple) { diff --git a/tools/clang-cc/Options.cpp b/tools/clang-cc/Options.cpp index 9c4216749e..b5190ebcae 100644 --- a/tools/clang-cc/Options.cpp +++ b/tools/clang-cc/Options.cpp @@ -1121,9 +1121,6 @@ void clang::InitializeLangOptions(LangOptions &Options, Options.setVisibilityMode(SymbolVisibility); Options.OverflowChecking = OverflowChecking; - // Allow the target to set the default the language options as it sees fit. - Target.getDefaultLangOptions(Options); - if (LangStd == lang_unspecified) { // Based on the base language, pick one. switch (IK) {