aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-10-01 00:01:53 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-10-01 00:01:53 +0000
commit9747739d0dd3077763100c28a134cc1f332df3d4 (patch)
tree9e412b0329e8ccd3d0964bfb067b8cc950679803
parent87e34329c7237877b904d9c977243e629c89ac73 (diff)
Output debug info. for ivars declared in class
extension and implementation. Fixes rdar://8493239. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115248 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp5
-rw-r--r--test/CodeGenObjC/debug-info-default-synth-ivar.m34
2 files changed, 36 insertions, 3 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 29a4377dd1..30165961e5 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -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
index 0000000000..f121e40750
--- /dev/null
+++ b/test/CodeGenObjC/debug-info-default-synth-ivar.m
@@ -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