aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-20 07:11:47 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-20 07:11:47 +0000
commitc7c6dc0c7ad547f03778502a63a18c3277dd93b5 (patch)
tree73c92ef3c2091fa53b5c21289c019cc5c0cb3cc6
parent9378ba44b3f46d697653003c784be87746e138d2 (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69581 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGObjCMac.cpp15
-rw-r--r--test/CodeGenObjC/image-info.m2
2 files changed, 14 insertions, 3 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 0c7b6f6160..b95e67e707 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -2426,9 +2426,15 @@ llvm::Value *CGObjCMac::EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
/// 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 @@ void CGObjCMac::EmitImageInfo() {
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] = {
diff --git a/test/CodeGenObjC/image-info.m b/test/CodeGenObjC/image-info.m
new file mode 100644
index 0000000000..e8650129e3
--- /dev/null
+++ b/test/CodeGenObjC/image-info.m
@@ -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