[llvm] [ORC] Add automatic shared library resolver for unresolved symbols. (PR #148410)
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 30 22:36:52 PDT 2025
================
@@ -0,0 +1,173 @@
+//===--- SymbolFilter.h - Utils for Symbol Filter ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_SYMBOLFILTER_H
+#define LLVM_EXECUTIONENGINE_ORC_SHARED_SYMBOLFILTER_H
+
+#include "llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h"
+
+#include <cmath>
+#include <type_traits>
+#include <vector>
+
+namespace llvm {
+namespace orc {
+
+namespace shared {
+using SPSBloomFilter =
+ SPSTuple<bool, uint32_t, uint32_t, uint32_t, SPSSequence<uint64_t>>;
+}
+
+class BloomFilter {
+public:
+ using HashFunc = std::function<uint32_t(StringRef)>;
+
+ BloomFilter() = default;
+ BloomFilter(BloomFilter &&) noexcept = default;
+ BloomFilter &operator=(BloomFilter &&) noexcept = default;
+ BloomFilter(const BloomFilter &) = delete;
+ BloomFilter &operator=(const BloomFilter &) = delete;
+
+ BloomFilter(uint32_t symbolCount, float falsePositiveRate, HashFunc hashFn)
+ : hashFunc(std::move(hashFn)) {
+ initialize(symbolCount, falsePositiveRate);
+ }
----------------
lhames wrote:
LLVM variable names should start with an upper-case letter (https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly)
https://github.com/llvm/llvm-project/pull/148410
More information about the llvm-commits
mailing list