summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp8
-rw-r--r--clang/test/CodeGenObjC/PR4541.m19
2 files changed, 25 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 9bab9269772..3d7417df30e 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -501,7 +501,9 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
// 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 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
// 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;
}
diff --git a/clang/test/CodeGenObjC/PR4541.m b/clang/test/CodeGenObjC/PR4541.m
new file mode 100644
index 00000000000..9a651162c1e
--- /dev/null
+++ b/clang/test/CodeGenObjC/PR4541.m
@@ -0,0 +1,19 @@
+// RUN: clang-cc -o %t -w -g %s
+
+
+@class NSString;
+@interface NSAttributedString
+- (NSString *)string;
+@end
+@interface NSMutableAttributedString : NSAttributedString
+@end
+@class NSImage;
+@implementation CYObjectsController
++ (void)initialize {
+}
++ (NSAttributedString *)attributedStringWithString:(id)string image:(NSImage *)image {
+ NSMutableAttributedString *attrStr;
+}
+@end
+
+
OpenPOWER on IntegriCloud