Update debug info type cache after fwd decl is replaced by real decl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75473 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 9bab926..3d7417d 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -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;
 }