LLVM: include/llvm/ADT/EpochTracker.h Source File (original) (raw)
Go to the documentation of this file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef LLVM_ADT_EPOCHTRACKER_H
17#define LLVM_ADT_EPOCHTRACKER_H
18
19#include "llvm/Config/abi-breaking.h"
20
21#include
22
23namespace llvm {
24
25#if LLVM_ENABLE_ABI_BREAKING_CHECKS
26#define LLVM_DEBUGEPOCHBASE_HANDLEBASE_EMPTYBASE
27
28
29
30
31
32
33
34
35
36
38 uint64_t Epoch = 0;
39
40public:
41 DebugEpochBase() = default;
42
43
44
46
47
48
50
51
52
53
54
55
56
57
58
60 const uint64_t *EpochAddress = nullptr;
61 uint64_t EpochAtCreation = UINT64_MAX;
62
63 public:
65
66 explicit HandleBase(const DebugEpochBase *Parent)
67 : EpochAddress(&Parent->Epoch), EpochAtCreation(Parent->Epoch) {}
68
69
70
71
72 bool isHandleInSync() const { return *EpochAddress == EpochAtCreation; }
73
74
75
76
77 const void *getEpochAddress() const { return EpochAddress; }
78 };
79};
80
81#else
82#ifdef _MSC_VER
83#define LLVM_DEBUGEPOCHBASE_HANDLEBASE_EMPTYBASE __declspec(empty_bases)
84#else
85#define LLVM_DEBUGEPOCHBASE_HANDLEBASE_EMPTYBASE
86#endif
87
100
101#endif
102
103}
104
105#endif
Definition EpochTracker.h:92
const void * getEpochAddress() const
Definition EpochTracker.h:97
HandleBase(const DebugEpochBase *)
Definition EpochTracker.h:95
bool isHandleInSync() const
Definition EpochTracker.h:96
Definition EpochTracker.h:88
void incrementEpoch()
Definition EpochTracker.h:90
This is an optimization pass for GlobalISel generic memory operations.