[llvm] 8e010ac - [WebAssembly] Avoid repeated hash lookups (NFC) (#112124)

via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 13 07:36:52 PDT 2024


Author: Kazu Hirata
Date: 2024-10-13T07:36:49-07:00
New Revision: 8e010ac5a173c9dee44b44324169a3e100a1a6fc

URL: https://github.com/llvm/llvm-project/commit/8e010ac5a173c9dee44b44324169a3e100a1a6fc
DIFF: https://github.com/llvm/llvm-project/commit/8e010ac5a173c9dee44b44324169a3e100a1a6fc.diff

LOG: [WebAssembly] Avoid repeated hash lookups (NFC) (#112124)

Added: 
    

Modified: 
    llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
index b999f83507f4ce..493e391964ac14 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
@@ -575,8 +575,9 @@ Function *WebAssemblyLowerEmscriptenEHSjLj::getInvokeWrapper(CallBase *CI) {
   FunctionType *CalleeFTy = CI->getFunctionType();
 
   std::string Sig = getSignature(CalleeFTy);
-  if (InvokeWrappers.contains(Sig))
-    return InvokeWrappers[Sig];
+  auto It = InvokeWrappers.find(Sig);
+  if (It != InvokeWrappers.end())
+    return It->second;
 
   // Put the pointer to the callee as first argument
   ArgTys.push_back(PointerType::getUnqual(CalleeFTy));


        


More information about the llvm-commits mailing list