[cfe-commits] r75473 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenObjC/PR4541.m

Devang Patel dpatel at apple.com
Mon Jul 13 10:03:14 PDT 2009


Author: dpatel
Date: Mon Jul 13 12:03:14 2009
New Revision: 75473

URL: http://llvm.org/viewvc/llvm-project?rev=75473&view=rev
Log:
Update debug info type cache after fwd decl is replaced by real decl.

Added:
    cfe/trunk/test/CodeGenObjC/PR4541.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=75473&r1=75472&r2=75473&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Jul 13 12:03:14 2009
@@ -501,7 +501,9 @@
   // old decl with the new one.  This will recursively update the debug info.
   FwdDecl.getGV()->replaceAllUsesWith(RealDecl.getGV());
   FwdDecl.getGV()->eraseFromParent();
-  
+
+  // Update TypeCache.
+  TypeCache[QualType(Ty, 0).getAsOpaquePtr()] = RealDecl;  
   return RealDecl;
 }
 
@@ -626,7 +628,9 @@
   // old decl with the new one.  This will recursively update the debug info.
   FwdDecl.getGV()->replaceAllUsesWith(RealDecl.getGV());
   FwdDecl.getGV()->eraseFromParent();
-  
+
+  // Update TypeCache.
+  TypeCache[QualType(Ty, 0).getAsOpaquePtr()] = RealDecl;  
   return RealDecl;
 }
 

Added: cfe/trunk/test/CodeGenObjC/PR4541.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/PR4541.m?rev=75473&view=auto

==============================================================================
--- cfe/trunk/test/CodeGenObjC/PR4541.m (added)
+++ cfe/trunk/test/CodeGenObjC/PR4541.m Mon Jul 13 12:03:14 2009
@@ -0,0 +1,19 @@
+// RUN: clang-cc -o %t -w  -g %s
+
+
+ at class NSString;
+ at interface NSAttributedString 
+- (NSString *)string;
+ at end 
+ at interface NSMutableAttributedString : NSAttributedString 
+ at end 
+ at class NSImage;
+ at implementation CYObjectsController 
++ (void)initialize {
+}
++ (NSAttributedString *)attributedStringWithString:(id)string image:(NSImage *)image  {
+  NSMutableAttributedString *attrStr;
+}
+ at end
+
+





More information about the cfe-commits mailing list