[clang] [llvm] [PowerPC] frontend get target feature from backend with cpu name (PR #137670)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 11 20:18:51 PDT 2025


================
@@ -18,6 +18,53 @@
 using namespace llvm;
 using namespace AMDGPU;
 
+/// Find KV in array using binary search.
+static const BasicSubtargetSubTypeKV *
+Find(StringRef S, ArrayRef<BasicSubtargetSubTypeKV> A) {
+  // Binary search the array
+  auto F = llvm::lower_bound(A, S);
+  // If not found then return NULL
+  if (F == A.end() || StringRef(F->Key) != S)
+    return nullptr;
+  // Return the found array item
+  return F;
+}
+
+/// For each feature that is (transitively) implied by this feature, set it.
+static void SetImpliedBits(FeatureBitset &Bits, const FeatureBitset &Implies,
----------------
MaskRay wrote:

setImpliedBits

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


More information about the cfe-commits mailing list