From: David Blaikie Date: Tue, 21 May 2013 18:08:19 +0000 (+0000) Subject: Debug Info: don't bother reinserting elements into maps we just retrieved them from X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=297dee826f8979a2b910e46b96d59c5308f638f6;p=clang Debug Info: don't bother reinserting elements into maps we just retrieved them from (no intended behavior change) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182403 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 8a6448aaaf..726f7361fc 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1936,16 +1936,17 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty, llvm::DIFile Unit) { ::iterator it = ObjCInterfaceCache.find(TyPtr); if (it != ObjCInterfaceCache.end()) TC = llvm::DIType(cast(it->second.first)); - else + else { TC = DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_structure_type, Decl->getName(), TheCU, Unit, getLineNumber(Decl->getLocation()), TheCU.getLanguage()); - // Store the forward declaration in the cache. - ObjCInterfaceCache[TyPtr] = std::make_pair(TC, Checksum(Decl)); + // Store the forward declaration in the cache. + ObjCInterfaceCache[TyPtr] = std::make_pair(TC, Checksum(Decl)); - // Register the type for replacement in finalize(). - ReplaceMap.push_back(std::make_pair(TyPtr, static_cast(TC))); + // Register the type for replacement in finalize(). + ReplaceMap.push_back(std::make_pair(TyPtr, static_cast(TC))); + } return TC; }