[llvm] 8b8778b - [WebAssembly] Use heterogenous lookups with std::set (NFC) (#114930)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 09:39:04 PST 2024


Author: Kazu Hirata
Date: 2024-11-05T09:38:53-08:00
New Revision: 8b8778bae5aab471e426632c755fff1fff0ec979

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

LOG: [WebAssembly] Use heterogenous lookups with std::set (NFC) (#114930)

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 493e391964ac14..5aef016720cf4c 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
@@ -318,7 +318,7 @@ class WebAssemblyLowerEmscriptenEHSjLj final : public ModulePass {
   // Map of <function signature string, invoke_ wrappers>
   StringMap<Function *> InvokeWrappers;
   // Set of allowed function names for exception handling
-  std::set<std::string> EHAllowlistSet;
+  std::set<std::string, std::less<>> EHAllowlistSet;
   // Functions that contains calls to setjmp
   SmallPtrSet<Function *, 8> SetjmpUsers;
 
@@ -349,8 +349,8 @@ class WebAssemblyLowerEmscriptenEHSjLj final : public ModulePass {
 
   bool areAllExceptionsAllowed() const { return EHAllowlistSet.empty(); }
   bool supportsException(const Function *F) const {
-    return EnableEmEH && (areAllExceptionsAllowed() ||
-                          EHAllowlistSet.count(std::string(F->getName())));
+    return EnableEmEH &&
+           (areAllExceptionsAllowed() || EHAllowlistSet.count(F->getName()));
   }
   void replaceLongjmpWith(Function *LongjmpF, Function *NewF);
 


        


More information about the llvm-commits mailing list