r227215 - Added more PS4 defaults for code generation

Filipe Cabecinhas me at filcab.net
Tue Jan 27 09:27:37 PST 2015


Author: filcab
Date: Tue Jan 27 11:27:37 2015
New Revision: 227215

URL: http://llvm.org/viewvc/llvm-project?rev=227215&view=rev
Log:
Added more PS4 defaults for code generation

Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=227215&r1=227214&r2=227215&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Jan 27 11:27:37 2015
@@ -1444,6 +1444,10 @@ static const char *getX86TargetCPU(const
     return Is64Bit ? "core2" : "yonah";
   }
 
+  // Set up default CPU name for PS4 compilers.
+  if (Triple.isPS4CPU())
+    return "btver2";
+
   // On Android use targets compatible with gcc
   if (Triple.getEnvironment() == llvm::Triple::Android)
     return Is64Bit ? "x86-64" : "i686";
@@ -1970,7 +1974,8 @@ static void addExceptionArgs(const ArgLi
   }
 
   if (types::isCXX(InputType)) {
-    bool CXXExceptionsEnabled = Triple.getArch() != llvm::Triple::xcore;
+    bool CXXExceptionsEnabled =
+        Triple.getArch() != llvm::Triple::xcore && !Triple.isPS4CPU();
     if (Arg *A = Args.getLastArg(options::OPT_fcxx_exceptions,
                                  options::OPT_fno_cxx_exceptions,
                                  options::OPT_fexceptions,
@@ -2301,10 +2306,12 @@ static bool shouldUseFramePointerForTarg
   case llvm::Triple::systemz:
   case llvm::Triple::x86:
   case llvm::Triple::x86_64:
-    if (Triple.isOSLinux())
+    if (Triple.isOSLinux()) {
       if (Arg *A = Args.getLastArg(options::OPT_O_Group))
         if (!A->getOption().matches(options::OPT_O0))
           return false;
+    } else if (Triple.isPS4CPU())
+      return false;
     return true;
   case llvm::Triple::xcore:
     return false;





More information about the cfe-commits mailing list