[llvm] 28f9041 - [DebugInfo] Use DenseMap::lookup (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 21:19:23 PST 2024


Author: Kazu Hirata
Date: 2024-01-22T21:19:11-08:00
New Revision: 28f9041879620b44505d54670f5ccb2ed48b24d9

URL: https://github.com/llvm/llvm-project/commit/28f9041879620b44505d54670f5ccb2ed48b24d9
DIFF: https://github.com/llvm/llvm-project/commit/28f9041879620b44505d54670f5ccb2ed48b24d9.diff

LOG: [DebugInfo] Use DenseMap::lookup (NFC)

Added: 
    

Modified: 
    llvm/lib/DebugInfo/DWARF/DWARFContext.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index e6df590b8dd7a0..792df53d304aa7 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -1353,11 +1353,7 @@ DWARFTypeUnit *DWARFContext::getTypeUnitForHash(uint16_t Version, uint64_t Hash,
           DWOUnits.getUnitForIndexEntry(*R));
     return nullptr;
   }
-  const DenseMap<uint64_t, DWARFTypeUnit *> &Map = State->getTypeUnitMap(IsDWO);
-  auto Iter = Map.find(Hash);
-  if (Iter != Map.end())
-    return Iter->second;
-  return nullptr;
+  return State->getTypeUnitMap(IsDWO).lookup(Hash);
 }
 
 DWARFCompileUnit *DWARFContext::getDWOCompileUnitForHash(uint64_t Hash) {


        


More information about the llvm-commits mailing list