#ifndef LLVM_ADT_EPOCH_TRACKER_H
#define LLVM_ADT_EPOCH_TRACKER_H
+#include "llvm/Config/llvm-config.h"
+
#include <cstdint>
namespace llvm {
-#ifdef NDEBUG
+#ifndef LLVM_ENABLE_ABI_BREAKING_CHECKS
class DebugEpochBase {
public:
class HandleBase {
public:
- HandleBase() {}
+ HandleBase() = default;
explicit HandleBase(const DebugEpochBase *) {}
- bool isHandleInSync() { return true; }
+ bool isHandleInSync() const { return true; }
+ const void *getEpochAddress() const { return nullptr; }
};
};
bool isHandleInSync() const { return *EpochAddress == EpochAtCreation; }
/// \brief Returns a pointer to the epoch word stored in the data structure
- /// this handle points into.
- const uint64_t *getEpochAddress() const { return EpochAddress; }
+ /// this handle points into. Can be used to check if two iterators point
+ /// into the same data structure.
+ const void *getEpochAddress() const { return EpochAddress; }
};
};
-#endif
+#endif // LLVM_ENABLE_ABI_BREAKING_CHECKS
} // namespace llvm