[cfe-commits] r115248 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenObjC/debug-info-default-synth-ivar.m

Fariborz Jahanian fjahanian at apple.com
Thu Sep 30 17:01:53 PDT 2010


Author: fjahanian
Date: Thu Sep 30 19:01:53 2010
New Revision: 115248

URL: http://llvm.org/viewvc/llvm-project?rev=115248&view=rev
Log:
Output debug info. for ivars declared in class
extension and implementation.
Fixes rdar://8493239.

Added:
    cfe/trunk/test/CodeGenObjC/debug-info-default-synth-ivar.m
Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=115248&r1=115247&r2=115248&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Sep 30 19:01:53 2010
@@ -1114,9 +1114,8 @@
   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();

Added: cfe/trunk/test/CodeGenObjC/debug-info-default-synth-ivar.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/debug-info-default-synth-ivar.m?rev=115248&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/debug-info-default-synth-ivar.m (added)
+++ cfe/trunk/test/CodeGenObjC/debug-info-default-synth-ivar.m Thu Sep 30 19:01:53 2010
@@ -0,0 +1,34 @@
+// RUN: %clang -fverbose-asm -g -S %s -o - | grep DW_AT_name | count 42
+// rdar://8493239
+
+ at class NSString;
+
+ at interface InstanceVariablesEverywhereButTheInterface 
+ at end
+
+ at interface InstanceVariablesEverywhereButTheInterface()
+{
+  NSString *_someString;
+}
+
+ at property(readonly) NSString *someString;
+ at property(readonly) unsigned long someNumber;
+ at end
+
+ at implementation InstanceVariablesEverywhereButTheInterface
+{
+  unsigned long _someNumber;
+}
+ at synthesize someString = _someString, someNumber = _someNumber;
+ at end
+
+ at interface AutomaticSynthesis
+{
+  int real_ivar;
+}
+ at property(copy) NSString *someString;
+ at property unsigned long someNumber;
+ at end
+
+ at implementation AutomaticSynthesis
+ at end





More information about the cfe-commits mailing list