]> granicus.if.org Git - clang/commitdiff
Do not add AT_APPLE_objc_class_extension attribute if @implementation is not seen.
authorDevang Patel <dpatel@apple.com>
Thu, 12 May 2011 21:14:54 +0000 (21:14 +0000)
committerDevang Patel <dpatel@apple.com>
Thu, 12 May 2011 21:14:54 +0000 (21:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131242 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
test/CodeGenObjC/debug-info-class-extension3.m [new file with mode: 0644]

index 3519cd1f385a66a27a365209a68066a7476483aa..6def71fe5464c9baed247bbcb6b39de70232058c 100644 (file)
@@ -1242,8 +1242,7 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
   uint64_t Align = CGM.getContext().getTypeAlign(Ty);
 
   unsigned Flags = 0;
-  if (ID->getFirstClassExtension() || 
-      (ID->getImplementation() && !ID->getImplementation()->ivar_empty()))
+  if (ID->getImplementation())
     Flags |= llvm::DIDescriptor::FlagObjcClassExtension;
 
   llvm::DIType RealDecl =
diff --git a/test/CodeGenObjC/debug-info-class-extension3.m b/test/CodeGenObjC/debug-info-class-extension3.m
new file mode 100644 (file)
index 0000000..549a2ad
--- /dev/null
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -masm-verbose -S -g %s -o - | FileCheck %s
+
+// CHECK-NOT: AT_APPLE_objc_class_extension
+
+@interface Foo {} @end
+
+@interface Foo () {
+    int *bar;
+}
+@end
+
+void bar(Foo *fptr) {}