LLVM API Documentation
StringRefMemoryObject - Simple StringRef-backed MemoryObject. More...
#include <StringRefMemoryObject.h>
Public Member Functions | |
StringRefMemoryObject (StringRef Bytes, uint64_t Base=0) | |
uint64_t | getBase () const override |
uint64_t | getExtent () const override |
int | readByte (uint64_t Addr, uint8_t *Byte) const override |
int | readBytes (uint64_t Addr, uint64_t Size, uint8_t *Buf) const override |
StringRefMemoryObject - Simple StringRef-backed MemoryObject.
Definition at line 25 of file StringRefMemoryObject.h.
llvm::StringRefMemoryObject::StringRefMemoryObject | ( | StringRef | Bytes, |
uint64_t | Base = 0 |
||
) | [inline] |
Definition at line 29 of file StringRefMemoryObject.h.
uint64_t llvm::StringRefMemoryObject::getBase | ( | ) | const [inline, override, virtual] |
getBase - Returns the lowest valid address in the region.
Implements llvm::MemoryObject.
Definition at line 32 of file StringRefMemoryObject.h.
uint64_t llvm::StringRefMemoryObject::getExtent | ( | ) | const [inline, override, virtual] |
getExtent - Returns the size of the region in bytes. (The region is contiguous, so the highest valid address of the region is getBase() + getExtent() - 1).
Implements llvm::MemoryObject.
Definition at line 33 of file StringRefMemoryObject.h.
References llvm::StringRef::size().
Referenced by readByte(), and readBytes().
int StringRefMemoryObject::readByte | ( | uint64_t | address, |
uint8_t * | ptr | ||
) | const [override, virtual] |
readByte - Tries to read a single byte from the region.
address | - The address of the byte, in the same space as getBase(). |
ptr | - A pointer to a byte to be filled in. Must be non-NULL. |
Implements llvm::MemoryObject.
Definition at line 14 of file StringRefMemoryObject.cpp.
References getExtent().
int StringRefMemoryObject::readBytes | ( | uint64_t | address, |
uint64_t | size, | ||
uint8_t * | buf | ||
) | const [override, virtual] |
readBytes - Tries to read a contiguous range of bytes from the region, up to the end of the region. You should override this function if there is a quicker way than going back and forth with individual bytes.
address | - The address of the first byte, in the same space as getBase(). |
size | - The number of bytes to copy. |
buf | - A pointer to a buffer to be filled in. Must be non-NULL and large enough to hold size bytes. |
Reimplemented from llvm::MemoryObject.
Definition at line 21 of file StringRefMemoryObject.cpp.
References llvm::StringRef::data(), getExtent(), and llvm::LibFunc::memcpy.