]> granicus.if.org Git - clang/commitdiff
Output debug info. for ivars declared in class
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 1 Oct 2010 00:01:53 +0000 (00:01 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 1 Oct 2010 00:01:53 +0000 (00:01 +0000)
extension and implementation.
Fixes rdar://8493239.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115248 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 29a4377dd1344669e99d6850a9c1f2be6bbf8ed3..30165961e57249c04ebea7a374d8367edd638eec 100644 (file)
@@ -1114,9 +1114,8 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
   const ASTRecordLayout &RL = CGM.getContext().getASTObjCInterfaceLayout(ID);
 
   unsigned FieldNo = 0;
-  for (ObjCInterfaceDecl::ivar_iterator I = ID->ivar_begin(),
-         E = ID->ivar_end();  I != E; ++I, ++FieldNo) {
-    ObjCIvarDecl *Field = *I;
+  for (ObjCIvarDecl *Field = ID->all_declared_ivar_begin(); Field;
+       Field = Field->getNextIvar()) {
     llvm::DIType FieldTy = getOrCreateType(Field->getType(), Unit);
 
     llvm::StringRef FieldName = Field->getName();
diff --git a/test/CodeGenObjC/debug-info-default-synth-ivar.m b/test/CodeGenObjC/debug-info-default-synth-ivar.m
new file mode 100644 (file)
index 0000000..f121e40
--- /dev/null
@@ -0,0 +1,34 @@
+// RUN: %clang -fverbose-asm -g -S %s -o - | grep DW_AT_name | count 42
+// rdar://8493239
+
+@class NSString;
+
+@interface InstanceVariablesEverywhereButTheInterface 
+@end
+
+@interface InstanceVariablesEverywhereButTheInterface()
+{
+  NSString *_someString;
+}
+
+@property(readonly) NSString *someString;
+@property(readonly) unsigned long someNumber;
+@end
+
+@implementation InstanceVariablesEverywhereButTheInterface
+{
+  unsigned long _someNumber;
+}
+@synthesize someString = _someString, someNumber = _someNumber;
+@end
+
+@interface AutomaticSynthesis
+{
+  int real_ivar;
+}
+@property(copy) NSString *someString;
+@property unsigned long someNumber;
+@end
+
+@implementation AutomaticSynthesis
+@end