[Coroutines] Avoid repeated hash lookups (NFC) (#126432)

This commit is contained in:
Kazu Hirata 2025-02-09 13:35:12 -08:00 committed by GitHub
parent d1af9ca9fd
commit df25511f0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -752,13 +752,14 @@ static void buildFrameDebugInfo(Function &F, coro::Shape &Shape,
dwarf::DW_ATE_unsigned_char)});
for (auto *V : FrameData.getAllDefs()) {
if (!DIVarCache.contains(V))
auto It = DIVarCache.find(V);
if (It == DIVarCache.end())
continue;
auto Index = FrameData.getFieldIndex(V);
NameCache.insert({Index, DIVarCache[V]->getName()});
TyCache.insert({Index, DIVarCache[V]->getType()});
NameCache.insert({Index, It->second->getName()});
TyCache.insert({Index, It->second->getType()});
}
// Cache from index to (Align, Offset Pair)