aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-09-28 13:08:54 -0700
committerGitHub <noreply@github.com>2024-09-28 13:08:54 -0700
commit871e32bd2ef2910d800db9807d5136dd1d866d8a (patch)
treea27cf3d4a9733164d0e1bb680966a164b36b6d69 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
parentdeda2f03f81e4f53a418455da0224e6a212adb10 (diff)
downloadllvm-871e32bd2ef2910d800db9807d5136dd1d866d8a.zip
llvm-871e32bd2ef2910d800db9807d5136dd1d866d8a.tar.gz
llvm-871e32bd2ef2910d800db9807d5136dd1d866d8a.tar.bz2
[AsmPrinter] Avoid repeated hash lookups (NFC) (#110376)
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 5cba2cb..a692e7a 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");