From 9c3a0188cd6ade50de9b2cd5feeafa0d03692b7c Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Mon, 13 Jul 2009 17:03:14 +0000 Subject: Update debug info type cache after fwd decl is replaced by real decl. llvm-svn: 75473 --- clang/lib/CodeGen/CGDebugInfo.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp') 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; } -- cgit v1.2.3