17 #ifndef LLVM_SUPPORT_ATOMICORDERING_H 18 #define LLVM_SUPPORT_ATOMICORDERING_H 81 static const char *names[8] = {
"not_atomic",
"unordered",
"monotonic",
82 "consume",
"acquire",
"release",
83 "acq_rel",
"seq_cst"};
84 return names[
static_cast<size_t>(ao)];
90 static const bool lookup[8][8] = {
92 {
false,
false,
false,
false,
false,
false,
false,
false},
93 {
true,
false,
false,
false,
false,
false,
false,
false},
94 {
true,
true,
false,
false,
false,
false,
false,
false},
95 {
true,
true,
true,
false,
false,
false,
false,
false},
96 {
true,
true,
true,
true,
false,
false,
false,
false},
97 {
true,
true,
true,
false,
false,
false,
false,
false},
98 {
true,
true,
true,
true,
true,
true,
false,
false},
99 {
true,
true,
true,
true,
true,
true,
true,
false},
101 return lookup[
static_cast<size_t>(ao)][static_cast<size_t>(other)];
105 static const bool lookup[8][8] = {
107 {
true,
false,
false,
false,
false,
false,
false,
false},
108 {
true,
true,
false,
false,
false,
false,
false,
false},
109 {
true,
true,
true,
false,
false,
false,
false,
false},
110 {
true,
true,
true,
true,
false,
false,
false,
false},
111 {
true,
true,
true,
true,
true,
false,
false,
false},
112 {
true,
true,
true,
false,
false,
true,
false,
false},
113 {
true,
true,
true,
true,
true,
true,
true,
false},
114 {
true,
true,
true,
true,
true,
true,
true,
true},
116 return lookup[
static_cast<size_t>(ao)][static_cast<size_t>(other)];
146 return lookup[
static_cast<size_t>(ao)];
151 #endif // LLVM_SUPPORT_ATOMICORDERING_H
bool isStrongerThanUnordered(AtomicOrdering ao)
This class represents lattice values for constants.
bool isValidAtomicOrdering(Int I)
bool operator>(int64_t V1, const APSInt &V2)
static bool lookup(const GsymReader &GR, DataExtractor &Data, uint64_t &Offset, uint64_t BaseAddr, uint64_t Addr, SourceLocations &SrcLocs, llvm::Error &Err)
A Lookup helper functions.
bool operator<=(int64_t V1, const APSInt &V2)
bool operator>=(int64_t V1, const APSInt &V2)
bool isStrongerThan(AtomicOrdering ao, AtomicOrdering other)
Returns true if ao is stronger than other as defined by the AtomicOrdering lattice, which is based on C++'s definition.
AtomicOrdering
Atomic ordering for LLVM's memory model.
bool isStrongerThanMonotonic(AtomicOrdering ao)
bool isAtLeastOrStrongerThan(AtomicOrdering ao, AtomicOrdering other)
bool isValidAtomicOrderingCABI(Int I)
const char * toIRString(AtomicOrdering ao)
String used by LLVM IR to represent atomic ordering.
bool isAcquireOrStronger(AtomicOrdering ao)
AtomicOrderingCABI
Atomic ordering for C11 / C++11's memody models.
bool isReleaseOrStronger(AtomicOrdering ao)
AtomicOrderingCABI toCABI(AtomicOrdering ao)
bool operator<(int64_t V1, const APSInt &V2)