[llvm] [Core] Skip over target name in intrinsic name lookup (PR #109971)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 10:31:17 PDT 2024


================
@@ -248,6 +250,9 @@ int llvm::Intrinsic::lookupLLVMIntrinsicByName(ArrayRef<const char *> NameTable,
   // identical. By using strncmp we consider names with differing suffixes to
   // be part of the equal range.
   size_t CmpEnd = 4; // Skip the "llvm" component.
+  if (!Target.empty())
+    CmpEnd += 1 + Target.size(); // skip the .target component.
----------------
jurahul wrote:

The 1 + size() to logically match ".target".

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


More information about the llvm-commits mailing list