[llvm] 871e32b - [AsmPrinter] Avoid repeated hash lookups (NFC) (#110376)

via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 28 13:08:58 PDT 2024


Author: Kazu Hirata
Date: 2024-09-28T13:08:54-07:00
New Revision: 871e32bd2ef2910d800db9807d5136dd1d866d8a

URL: https://github.com/llvm/llvm-project/commit/871e32bd2ef2910d800db9807d5136dd1d866d8a
DIFF: https://github.com/llvm/llvm-project/commit/871e32bd2ef2910d800db9807d5136dd1d866d8a.diff

LOG: [AsmPrinter] Avoid repeated hash lookups (NFC) (#110376)

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 5cba2cbc241e40..a692e7aef62684 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");


        


More information about the llvm-commits mailing list