From be9acc5f879a53e3e48921d9c7f7706b778af2aa Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 27 Sep 2024 08:32:27 -0700 Subject: [PATCH] [AsmPrinter] Avoid repeated hash lookups (NFC) --- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 5cba2cbc241e4..a692e7aef6268 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -3406,10 +3406,8 @@ void CodeViewDebug::emitDebugInfoForGlobal(const CVGlobalVariable &CVGV) { OS.emitInt32(getCompleteTypeIndex(DIGV->getType()).getIndex()); OS.AddComment("DataOffset"); - uint64_t Offset = 0; - if (CVGlobalVariableOffsets.contains(DIGV)) - // Use the offset seen while collecting info on globals. - Offset = CVGlobalVariableOffsets[DIGV]; + // Use the offset seen while collecting info on globals. + uint64_t Offset = CVGlobalVariableOffsets.lookup(DIGV); OS.emitCOFFSecRel32(GVSym, Offset); OS.AddComment("Segment");