[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)
Doug Wyatt via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 23 15:02:11 PDT 2024
================
@@ -4940,6 +4955,78 @@ class FunctionEffectsRef {
void dump(llvm::raw_ostream &OS) const;
};
+/// A mutable set of FunctionEffect::Kind.
+class FunctionEffectKindSet {
+ // For now this only needs to be a bitmap.
+ constexpr static size_t EndBitPos = 8;
+ using KindBitsT = std::bitset<EndBitPos>;
+
+ KindBitsT KindBits{};
+
+ explicit FunctionEffectKindSet(KindBitsT KB) : KindBits(KB) {}
+
+ constexpr static size_t kindToPos(FunctionEffect::Kind K) {
+ return static_cast<size_t>(K);
+ }
+
+public:
+ FunctionEffectKindSet() = default;
+ explicit FunctionEffectKindSet(FunctionEffectsRef FX) { insert(FX); }
+
+ // Iterates through the bits which are set.
+ class iterator {
----------------
dougsonos wrote:
Wow, it still builds when private, but I don't understand. Apparently the `for` loops which walk through this thing aren't being foiled by the privateness of the iterator.
https://github.com/llvm/llvm-project/pull/99656
More information about the cfe-commits
mailing list