[llvm] [ExecutionEngine] Simplify code with DenseMap::operator[] (NFC) (PR #115115)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 20:59:06 PST 2024


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/115115

None

>From 8a158b676558165a48275430ebd7dd635727f3bb Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 5 Nov 2024 10:03:10 -0800
Subject: [PATCH] [ExecutionEngine] Simplify code with DenseMap::operator[]
 (NFC)

---
 llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h b/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
index eda6feb441e672..3b8d4c8d1e246d 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
@@ -394,7 +394,7 @@ class StubsManager_v7 {
   using StubMapEntry = std::tuple<Symbol *, Symbol *>;
 
   Symbol *&getStubSymbolSlot(StringRef Name, bool Thumb) {
-    StubMapEntry &Stubs = StubMap.try_emplace(Name).first->second;
+    StubMapEntry &Stubs = StubMap[Name];
     if (Thumb)
       return std::get<1>(Stubs);
     return std::get<0>(Stubs);



More information about the llvm-commits mailing list