[cfe-commits] r89073 - in /cfe/trunk: include/clang/Basic/TargetInfo.h lib/Basic/Targets.cpp tools/clang-cc/Options.cpp

Daniel Dunbar daniel at zuster.org
Tue Nov 17 01:15:44 PST 2009


Author: ddunbar
Date: Tue Nov 17 03:15:44 2009
New Revision: 89073

URL: http://llvm.org/viewvc/llvm-project?rev=89073&view=rev
Log:
Eliminate TargetInfo::getDefaultLangOptions, this kind of logic is better done
in the driver.

Modified:
    cfe/trunk/include/clang/Basic/TargetInfo.h
    cfe/trunk/lib/Basic/Targets.cpp
    cfe/trunk/tools/clang-cc/Options.cpp

Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=89073&r1=89072&r2=89073&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Tue Nov 17 03:15:44 2009
@@ -342,11 +342,6 @@
     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.

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=89073&r1=89072&r2=89073&view=diff

==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Nov 17 03:15:44 2009
@@ -155,24 +155,6 @@
          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<typename Target>
 class DarwinTargetInfo : public OSTargetInfo<Target> {
@@ -183,12 +165,6 @@
     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<Target>(triple) {

Modified: cfe/trunk/tools/clang-cc/Options.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/Options.cpp?rev=89073&r1=89072&r2=89073&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/Options.cpp (original)
+++ cfe/trunk/tools/clang-cc/Options.cpp Tue Nov 17 03:15:44 2009
@@ -1121,9 +1121,6 @@
   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) {





More information about the cfe-commits mailing list