MIR Parser: Report an error when a jump table entry is redefined.
[oota-llvm.git] / include / llvm / ADT / EpochTracker.h
index 179822afb3206188bf7a0fe0ac27b9a62175aaef..582d58179d137571e3246b5c9f27755660c3431c 100644 (file)
 #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:
@@ -28,9 +30,10 @@ 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; }
   };
 };
 
@@ -83,12 +86,13 @@ public:
     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