diff options
author | Devang Patel <dpatel@apple.com> | 2011-03-23 16:29:39 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-03-23 16:29:39 +0000 |
commit | 945b8aed2a822c457d6b91a18370581e95ea85c0 (patch) | |
tree | 1525dfab45ee031c8b3691a30099d597ff184ddc /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | c4f0ab397c395b851a0304c31bc48759e010777b (diff) | |
download | bcm5719-llvm-945b8aed2a822c457d6b91a18370581e95ea85c0.tar.gz bcm5719-llvm-945b8aed2a822c457d6b91a18370581e95ea85c0.zip |
Update type cache when a type is completed.
Radar 9168773
llvm-svn: 128150
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index bf5e7a5d1a9..80bec0f0eeb 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1396,7 +1396,7 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty, // Unwrap the type as needed for debug information. Ty = UnwrapTypeForDebugInfo(Ty); - + // Check for existing entry. llvm::DenseMap<void *, llvm::WeakVH>::iterator it = TypeCache.find(Ty.getAsOpaquePtr()); @@ -2205,3 +2205,17 @@ CGDebugInfo::getOrCreateNameSpace(const NamespaceDecl *NSDecl) { NameSpaceCache[NSDecl] = llvm::WeakVH(NS); return NS; } + +/// UpdateCompletedType - Update type cache because the type is now +/// translated. +void CGDebugInfo::UpdateCompletedType(const TagDecl *TD) { + QualType Ty = CGM.getContext().getTagDeclType(TD); + + // If the type exist in type cache then remove it from the cache. + // There is no need to prepare debug info for the completed type + // right now. It will be generated on demand lazily. + llvm::DenseMap<void *, llvm::WeakVH>::iterator it = + TypeCache.find(Ty.getAsOpaquePtr()); + if (it != TypeCache.end()) + TypeCache.erase(it); +} |