[clang] [TableGen] Avoid repeated hash lookups (NFC) (PR #109372)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 20 09:03:13 PDT 2024


================
@@ -896,9 +896,8 @@ static void OCL2Qual(Sema &S, const OpenCLTypeStruct &Ty,
     if (ImageTypesMap.contains(T->getValueAsString("Name")))
       continue;
     // Check we have not seen this Type
-    if (TypesSeen.contains(T->getValueAsString("Name")))
+    if (!TypesSeen.try_emplace(T->getValueAsString("Name"), true).second)
----------------
kazutakahirata wrote:

The value doesn't seem to be used indeed.  Let me clean that up in a subsequent patch.

https://github.com/llvm/llvm-project/pull/109372


More information about the cfe-commits mailing list