]> granicus.if.org Git - clang/commitdiff
Revert "Set the default C standard to C99 when targeting the PS4."
authorSean Silva <chisophugis@gmail.com>
Wed, 6 Apr 2016 21:06:52 +0000 (21:06 +0000)
committerSean Silva <chisophugis@gmail.com>
Wed, 6 Apr 2016 21:06:52 +0000 (21:06 +0000)
This reverts r265359.

It breaks
- llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast
- llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast

Failing Tests (5):
    Clang :: FixIt/fixit-errors.c
    Clang :: Preprocessor/init.c
    Clang :: Sema/attr-deprecated.c
    Clang :: Sema/nullability.c
    Clang :: SemaObjC/objcbridge-attribute-arc.m

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265601 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/CompilerInvocation.h
lib/Frontend/CompilerInvocation.cpp
test/Preprocessor/init.c

index 6d964bda4c5d225e6a32cc2fedfa0461616c00c1..0b4a1e587e7e489055426b216add881c5b373466 100644 (file)
@@ -153,10 +153,8 @@ public:
   ///
   /// \param Opts - The LangOptions object to set up.
   /// \param IK - The input language.
-  /// \param T - The target triple.
   /// \param LangStd - The input language standard.
   static void setLangDefaults(LangOptions &Opts, InputKind IK,
-                   const llvm::Triple &T,
                    LangStandard::Kind LangStd = LangStandard::lang_unspecified);
   
   /// \brief Retrieve a module hash string that is suitable for uniquely 
index ba56665bc84c1e567babc91dd8894a0782575b03..9eedaad9920249ea07e8cc2fb0104938e8eba721 100644 (file)
@@ -1357,7 +1357,6 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) {
 }
 
 void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
-                                         const llvm::Triple &T,
                                          LangStandard::Kind LangStd) {
   // Set some properties which depend solely on the input kind; it would be nice
   // to move these to the language standard, and have the driver resolve the
@@ -1390,11 +1389,7 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
     case IK_PreprocessedC:
     case IK_ObjC:
     case IK_PreprocessedObjC:
-      // The PS4 uses C99 as the default C standard.
-      if (T.isPS4())
-        LangStd = LangStandard::lang_gnu99;
-      else
-        LangStd = LangStandard::lang_gnu11;
+      LangStd = LangStandard::lang_gnu11;
       break;
     case IK_CXX:
     case IK_PreprocessedCXX:
@@ -1548,8 +1543,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
       LangStd = OpenCLLangStd;
   }
 
-  llvm::Triple T(TargetOpts.Triple);
-  CompilerInvocation::setLangDefaults(Opts, IK, T, LangStd);
+  CompilerInvocation::setLangDefaults(Opts, IK, LangStd);
 
   // We abuse '-f[no-]gnu-keywords' to force overriding all GNU-extension
   // keywords. This behavior is provided by GCC's poorly named '-fasm' flag,
@@ -1872,6 +1866,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
   // Provide diagnostic when a given target is not expected to be an OpenMP
   // device or host.
   if (Opts.OpenMP && !Opts.OpenMPIsDevice) {
+    llvm::Triple T(TargetOpts.Triple);
     switch (T.getArch()) {
     default:
       break;
index 5f3284710a61bf00ee4b87d8a7488d32e95872e2..dbd4de605e510dc7cbfe2918b901644587ff0daa 100644 (file)
 // PS4:#define __SSE2__ 1
 // PS4:#define __SSE_MATH__ 1
 // PS4:#define __SSE__ 1
-// PS4:#define __STDC_VERSION__ 199901L
 // PS4:#define __UINTMAX_TYPE__ long unsigned int
 // PS4:#define __USER_LABEL_PREFIX__
 // PS4:#define __WCHAR_MAX__ 65535