From: Duncan P. N. Exon Smith Date: Fri, 24 Jul 2015 18:05:58 +0000 (+0000) Subject: DI: Make StaticDataMemberCache type-safe, NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71b79a5c01aa2ecb38b6fac99a0c137ee04e9845;p=clang DI: Make StaticDataMemberCache type-safe, NFC Change `StaticDataMemberCache` to store references to `DIDerivedType` directly, and remove now-unnecessary casts from the accessors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@243129 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 93a2287b1e..9d115e3c0c 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -972,7 +972,7 @@ void CGDebugInfo::CollectRecordFields( if (MI != StaticDataMemberCache.end()) { assert(MI->second && "Static data member declaration should still exist"); - elements.push_back(cast(MI->second)); + elements.push_back(MI->second); } else { auto Field = CreateRecordStaticField(V, RecordTy, record); elements.push_back(Field); @@ -3115,7 +3115,7 @@ CGDebugInfo::getOrCreateStaticDataMemberDeclarationOrNull(const VarDecl *D) { auto MI = StaticDataMemberCache.find(D->getCanonicalDecl()); if (MI != StaticDataMemberCache.end()) { assert(MI->second && "Static data member declaration should still exist"); - return cast(MI->second); + return MI->second; } // If the member wasn't found in the cache, lazily construct and add it to the diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h index 4c77a8d289..73227bc118 100644 --- a/lib/CodeGen/CGDebugInfo.h +++ b/lib/CodeGen/CGDebugInfo.h @@ -117,7 +117,8 @@ class CGDebugInfo { llvm::DenseMap NameSpaceCache; llvm::DenseMap NamespaceAliasCache; - llvm::DenseMap StaticDataMemberCache; + llvm::DenseMap> + StaticDataMemberCache; /// Helper functions for getOrCreateType. /// @{