14#ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_MEMORYFLAGS_H
15#define LLVM_EXECUTIONENGINE_ORC_SHARED_MEMORYFLAGS_H
45 std::underlying_type_t<sys::Memory::ProtectionFlags> PF = 0;
113 using underlying_type = uint8_t;
114 static constexpr unsigned BitsForProt = 3;
115 static constexpr unsigned BitsForLifetimePolicy = 2;
116 static constexpr unsigned MaxIdentifiers =
117 1U << (BitsForProt + BitsForLifetimePolicy);
132 : Id(static_cast<underlying_type>(MP) |
133 (static_cast<underlying_type>(MLP) << BitsForProt)) {}
137 return static_cast<MemProt>(Id & ((1U << BitsForProt) - 1));
142 return static_cast<MemLifetime>(Id >> BitsForProt);
158 AllocGroup(underlying_type RawId) : Id(RawId) {}
159 underlying_type Id = 0;
167 using ElemT = std::pair<AllocGroup, T>;
170 static bool compareKey(
const ElemT &
E,
const AllocGroup &
G) {
187 return (
I ==
end() ||
I->first ==
G) ?
I :
end();
195 if (
I == Elems.
end() ||
I->first !=
G)
217 using UT = std::underlying_type_t<orc::MemProt>;
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file defines DenseMapInfo traits for DenseMap.
iterator insert(iterator I, T &&Elt)
A specialized small-map for AllocGroups.
iterator find(AllocGroup G)
T & operator[](AllocGroup G)
AllocGroupSmallMap(std::initializer_list< std::pair< AllocGroup, T > > Inits)
AllocGroupSmallMap()=default
typename VectorTy::iterator iterator
A pair of memory protections and allocation policies.
static constexpr unsigned NumGroups
MemProt getMemProt() const
Returns the MemProt for this group.
friend bool operator==(const AllocGroup &LHS, const AllocGroup &RHS)
AllocGroup(MemProt MP)
Create an AllocGroup from a MemProt only – uses MemLifetime::Standard.
AllocGroup()=default
Create a default AllocGroup.
MemLifetime getMemLifetime() const
Returns the MemLifetime for this group.
friend bool operator<(const AllocGroup &LHS, const AllocGroup &RHS)
AllocGroup(MemProt MP, MemLifetime MLP)
Create an AllocGroup from a MemProt and a MemLifetime.
friend bool operator!=(const AllocGroup &LHS, const AllocGroup &RHS)
This class implements an extremely fast bulk output stream that can only output to a stream.
MemProt
Describes Read/Write/Exec permissions for memory.
MemProt fromSysMemoryProtectionFlags(sys::Memory::ProtectionFlags PF)
Convert a sys::Memory::ProtectionFlags value to a corresponding MemProt value.
MemLifetime
Describes a memory lifetime policy for memory to be allocated by a JITLinkMemoryManager.
@ NoAlloc
NoAlloc memory should not be allocated by the JITLinkMemoryManager at all.
@ Standard
Standard memory should be allocated by the allocator and then deallocated when the deallocate method ...
@ Finalize
Finalize memory should be allocated by the allocator, and then be overwritten and deallocated after a...
sys::Memory::ProtectionFlags toSysMemoryProtectionFlags(MemProt MP)
Convert a MemProt value to a corresponding sys::Memory::ProtectionFlags value.
raw_ostream & operator<<(raw_ostream &OS, const SymbolStringPtr &Sym)
Render a SymbolStringPtr.
This is an optimization pass for GlobalISel generic memory operations.
void sort(IteratorTy Start, IteratorTy End)
@ LLVM_MARK_AS_BITMASK_ENUM
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
static bool isEqual(const orc::AllocGroup &LHS, const orc::AllocGroup &RHS)
static orc::AllocGroup getEmptyKey()
static orc::AllocGroup getTombstoneKey()
static unsigned getHashValue(const orc::AllocGroup &Val)
static orc::MemProt getEmptyKey()
static bool isEqual(const orc::MemProt &LHS, const orc::MemProt &RHS)
static orc::MemProt getTombstoneKey()
static unsigned getHashValue(const orc::MemProt &Val)
An information struct used to provide DenseMap with the various necessary components for a given valu...
Function object to check whether the first component of a container supported by std::get (like std::...