[llvm] [ProfileData] Implement contains in SampleProfileNameTable (NFC) (PR #211995)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 28 21:20:58 PDT 2026


================
@@ -793,6 +847,14 @@ class LLVM_ABI SampleProfileReaderBinary : public SampleProfileReader {
     return {NameTable->begin(), NameTable->end()};
   }
 
+  bool contains(StringRef Key) const override {
+    return NameTable && NameTable->contains(Key);
----------------
kazutakahirata wrote:

It should be populated by the time `contains()` is called.  I've switched to an `assert`.

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


More information about the llvm-commits mailing list