]> granicus.if.org Git - clang/commitdiff
fix some differences between apple gcc and clang on darwin/x86-32.
authorChris Lattner <sabre@nondot.org>
Thu, 5 Feb 2009 07:19:24 +0000 (07:19 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 5 Feb 2009 07:19:24 +0000 (07:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63846 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
lib/Lex/Preprocessor.cpp
utils/CheckBuiltinMacros.sh

index c3e1a68d20f9e9470c520c9a1db02a485f6b6033..d79787615aa9bb4fc4dab01530a2b6529ebd86c8 100644 (file)
@@ -120,6 +120,9 @@ static bool getDarwinNumber(const char *Triple, unsigned &Maj, unsigned &Min) {
 static void getDarwinDefines(std::vector<char> &Defs, const char *Triple) {
   Define(Defs, "__APPLE__");
   Define(Defs, "__MACH__");
+  Define(Defs, "OBJC_NEW_PROPERTIES");
+  
+  // FIXME: OBJC_ZEROCOST_EXCEPTIONS when using zero cost eh.
   
   // Figure out which "darwin number" the target triple is.  "darwin9" -> 10.5.
   unsigned Maj, Min;
@@ -563,6 +566,7 @@ public:
   DarwinI386TargetInfo(const std::string& triple) : X86_32TargetInfo(triple) {
     LongDoubleWidth = 128;
     LongDoubleAlign = 128;
+    PtrDiffType = SignedInt;
     DescriptionString = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
                         "i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-"
                         "a0:0:64-f80:128:128";
index 3861e7d320ee76d1e06f0b0dfe257feb9535f418..14bddd68266e170fe6f044dcb4111441c117d430 100644 (file)
@@ -406,6 +406,8 @@ static void DefineFloatMacros(std::vector<char> &Buf, const char *Prefix,
   DefineBuiltinMacro(Buf, MacroBuf);
   sprintf(MacroBuf, "__%s_MIN__=%s", Prefix, Min);
   DefineBuiltinMacro(Buf, MacroBuf);
+  sprintf(MacroBuf, "__%s_HAS_DENORM__=1", Prefix);
+  DefineBuiltinMacro(Buf, MacroBuf);
 }
 
 
@@ -571,8 +573,10 @@ static void InitializePredefinedMacros(Preprocessor &PP,
     DefineBuiltinMacro(Buf, "__PTRDIFF_TYPE__=long int");
   else if (TI.getPtrDiffType(0) == TargetInfo::UnsignedInt)
     DefineBuiltinMacro(Buf, "__PTRDIFF_TYPE__=unsigned int");
-  else
+  else {
+    assert(TI.getPtrDiffType(0) == TargetInfo::SignedInt);
     DefineBuiltinMacro(Buf, "__PTRDIFF_TYPE__=int");
+  }
   
   if (TI.getSizeType() == TargetInfo::UnsignedLongLong)
     DefineBuiltinMacro(Buf, "__SIZE_TYPE__=unsigned long long int");
@@ -586,8 +590,10 @@ static void InitializePredefinedMacros(Preprocessor &PP,
     DefineBuiltinMacro(Buf, "__SIZE_TYPE__=unsigned int");
   else if (TI.getSizeType() == TargetInfo::SignedInt)
     DefineBuiltinMacro(Buf, "__SIZE_TYPE__=int");
-  else
+  else {
+    assert(TI.getPtrDiffType(0) == TargetInfo::UnsignedShort);
     DefineBuiltinMacro(Buf, "__SIZE_TYPE__=unsigned short");
+  }
   
   DefineFloatMacros(Buf, "FLT", &TI.getFloatFormat());
   DefineFloatMacros(Buf, "DBL", &TI.getDoubleFormat());
index 6a8573c0c14645711369cc92461464203527cf33..1c0b88a60b67b39ecf67961c069e25e4c848e468 100755 (executable)
@@ -2,7 +2,7 @@
 set -ex
 
 if [ -z "$CC" ]; then
-    CC="gcc"
+    CC="/Developer/usr/bin/gcc-4.2"
 fi
 
 SRCLANG=c