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

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 08:34:42 PST 2024


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

>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 1/3] [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);

>From da079386929e99b677642b7815ed034e097b83b8 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 6 Nov 2024 07:21:48 -0800
Subject: [PATCH 2/3] Trigger build


>From bde50fd4f9e760757daf9baa24e70c3c9c786460 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 6 Nov 2024 08:34:21 -0800
Subject: [PATCH 3/3] Trigger build




More information about the llvm-commits mailing list