16 #ifndef LLVM_ADT_EPOCH_TRACKER_H
17 #define LLVM_ADT_EPOCH_TRACKER_H
19 #include "llvm/Config/abi-breaking.h"
20 #include "llvm/Config/llvm-config.h"
26 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
60 const uint64_t *EpochAddress;
61 uint64_t EpochAtCreation;
64 HandleBase() : EpochAddress(nullptr), EpochAtCreation(UINT64_MAX) {}
67 : EpochAddress(&Parent->Epoch), EpochAtCreation(Parent->Epoch) {}
83 class DebugEpochBase {
96 #endif // LLVM_ENABLE_ABI_BREAKING_CHECKS
A base class for data structure classes wishing to make iterators ("handles") pointing into themselve...
const void * getEpochAddress() const
Returns a pointer to the epoch word stored in the data structure this handle points into...
~DebugEpochBase()
The destructor calls incrementEpoch to make use-after-free bugs more likely to crash deterministicall...
void incrementEpoch()
Calling incrementEpoch invalidates all handles pointing into the calling instance.
A base class for iterator classes ("handles") that wish to poll for iterator invalidating modificatio...
bool isHandleInSync() const
Returns true if the DebugEpochBase this Handle is linked to has not called incrementEpoch on itself s...
HandleBase(const DebugEpochBase *Parent)