13#ifndef LLVM_SUPPORT_MEMORY_H
14#define LLVM_SUPPORT_MEMORY_H
17#include <system_error>
37 void *
base()
const {
return Address; }
101 std::error_code &EC);
This class implements an extremely fast bulk output stream that can only output to a stream.
This class encapsulates the notion of a memory block which has an address and a size.
MemoryBlock(void *addr, size_t allocatedSize)
size_t allocatedSize() const
The size as it was allocated.
This class provides various memory handling functions that manipulate MemoryBlock instances.
static std::error_code releaseMappedMemory(MemoryBlock &Block)
This method releases a block of memory that was allocated with the allocateMappedMemory method.
static MemoryBlock allocateMappedMemory(size_t NumBytes, const MemoryBlock *const NearBlock, unsigned Flags, std::error_code &EC)
This method allocates a block of memory that is suitable for loading dynamically generated code (e....
@ MF_HUGE_HINT
The MF_HUGE_HINT flag is used to indicate that the request for a memory block should be satisfied wit...
static void InvalidateInstructionCache(const void *Addr, size_t Len)
InvalidateInstructionCache - Before the JIT can run a block of code that has been emitted it must inv...
static std::error_code protectMappedMemory(const MemoryBlock &Block, unsigned Flags)
This method sets the protection flags for a block of memory to the state specified by /p Flags.
Owning version of MemoryBlock.
MemoryBlock getMemoryBlock() const
OwningMemoryBlock()=default
OwningMemoryBlock(OwningMemoryBlock &&Other)
size_t allocatedSize() const
The size as it was allocated.
OwningMemoryBlock(MemoryBlock M)
std::error_code release()
OwningMemoryBlock & operator=(OwningMemoryBlock &&Other)
raw_ostream & operator<<(raw_ostream &OS, const Memory::ProtectionFlags &PF)
Debugging output for Memory::ProtectionFlags.
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.