[cfe-commits] r65413 - in /cfe/trunk/lib: Basic/Targets.cpp CodeGen/CGObjCMac.cpp

Fariborz Jahanian fjahanian at apple.com
Tue Feb 24 15:34:44 PST 2009


Author: fjahanian
Date: Tue Feb 24 17:34:44 2009
New Revision: 65413

URL: http://llvm.org/viewvc/llvm-project?rev=65413&view=rev
Log:
patch for two things.
make sure objc2's nonfragile abi is enacted for Leopard too.
add -fobjc-gc-only flag to the image_info symbol.


Modified:
    cfe/trunk/lib/Basic/Targets.cpp
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp

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

==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Feb 24 17:34:44 2009
@@ -152,11 +152,12 @@
   
   // Blocks default to on for 10.6 (darwin10) and beyond.
   // As does nonfragile-abi for 64bit mode
-  if (Maj > 9) {
+  if (Maj > 9) 
     Opts.Blocks = 1;
+
+  if (Maj >= 9)
     if (Opts.ObjC1 && !strncmp(Triple, "x86_64", 6))
       Opts.ObjCNonFragileABI = 1;
-  }
 }
 
 

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=65413&r1=65412&r2=65413&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Tue Feb 24 17:34:44 2009
@@ -3429,9 +3429,11 @@
   std::vector<llvm::Constant*> Values(2);
   Values[0] = llvm::ConstantInt::get(ObjCTypes.IntTy, 0);
   unsigned int flags = 0;
-  // FIXME -fobjc-gc-only flags is 6.
-  if (CGM.getContext().getLangOptions().getGCMode() != LangOptions::NonGC)
-    flags |= 2;
+  // FIXME: Fix and continue?
+  if (CGM.getLangOptions().getGCMode() != LangOptions::NonGC)
+    flags |= eImageInfo_GarbageCollected;
+  if (CGM.getLangOptions().getGCMode() == LangOptions::GCOnly)
+    flags |= eImageInfo_GCOnly;
   Values[1] = llvm::ConstantInt::get(ObjCTypes.IntTy, flags);
   llvm::Constant* Init = llvm::ConstantArray::get(
                                       llvm::ArrayType::get(ObjCTypes.IntTy, 2),





More information about the cfe-commits mailing list