[cfe-commits] r69581 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/image-info.m

Daniel Dunbar daniel at zuster.org
Mon Apr 20 00:11:48 PDT 2009


Author: ddunbar
Date: Mon Apr 20 02:11:47 2009
New Revision: 69581

URL: http://llvm.org/viewvc/llvm-project?rev=69581&view=rev
Log:
Set a bit in IMAGE_INFO to indicate that we don't contain any
@synthesized ivars for superclasses.
 - <rdar://problem/6806371> [clang] Mark code without miscompiled
   @synthesized properties

Added:
    cfe/trunk/test/CodeGenObjC/image-info.m
Modified:
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Mon Apr 20 02:11:47 2009
@@ -2426,9 +2426,15 @@
 ///   unsigned flags;
 /// };
 enum ImageInfoFlags {
-  eImageInfo_FixAndContinue   = (1 << 0), // FIXME: Not sure what this implies
-  eImageInfo_GarbageCollected = (1 << 1), 
-  eImageInfo_GCOnly           = (1 << 2)  
+  eImageInfo_FixAndContinue      = (1 << 0), // FIXME: Not sure what
+                                             // this implies.
+  eImageInfo_GarbageCollected    = (1 << 1), 
+  eImageInfo_GCOnly              = (1 << 2),  
+  eImageInfo_OptimizedByDyld     = (1 << 3), // FIXME: When is this set.
+
+  // A flag indicating that the module has no instances of an
+  // @synthesize of a superclass variable. <rdar://problem/6803242>
+  eImageInfo_CorrectedSynthesize = (1 << 4)
 };
 
 void CGObjCMac::EmitImageInfo() {
@@ -2440,6 +2446,9 @@
     flags |= eImageInfo_GarbageCollected;
   if (CGM.getLangOptions().getGCMode() == LangOptions::GCOnly)
     flags |= eImageInfo_GCOnly;
+  
+  // We never allow @synthesize of a superclass property.
+  flags |= eImageInfo_CorrectedSynthesize;
 
   // Emitted as int[2];
   llvm::Constant *values[2] = {

Added: cfe/trunk/test/CodeGenObjC/image-info.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/image-info.m?rev=69581&view=auto

==============================================================================
--- cfe/trunk/test/CodeGenObjC/image-info.m (added)
+++ cfe/trunk/test/CodeGenObjC/image-info.m Mon Apr 20 02:11:47 2009
@@ -0,0 +1,2 @@
+// RUN: clang-cc -triple x86_64-apple-darwin-10 -emit-llvm -o %t %s &&
+// RUN: grep -F '@"\01L_OBJC_IMAGE_INFO" = internal constant [2 x i32] [i32 0, i32 16], section "__OBJC, __image_info,regular"' %t





More information about the cfe-commits mailing list