|
LLVM
3.7.0
|
Interface to data which is actually streamed from a DataStreamer. More...
#include <StreamingMemoryObject.h>
Public Member Functions | |
| StreamingMemoryObject (std::unique_ptr< DataStreamer > Streamer) | |
| uint64_t | getExtent () const override |
| Returns the size of the region in bytes. More... | |
| uint64_t | readBytes (uint8_t *Buf, uint64_t Size, uint64_t Address) const override |
| Tries to read a contiguous range of bytes from the region, up to the end of the region. More... | |
| const uint8_t * | getPointer (uint64_t address, uint64_t size) const override |
| Ensures that the requested data is in memory, and returns a pointer to it. More... | |
| bool | isValidAddress (uint64_t address) const override |
| Returns true if the address is within the object (i.e. More... | |
| bool | dropLeadingBytes (size_t s) |
| Drop s bytes from the front of the stream, pushing the positions of the remaining bytes down by s. More... | |
| void | setKnownObjectSize (size_t size) |
| If the data object size is known in advance, many of the operations can be made more efficient, so this method should be called before reading starts (although it can be called anytime). More... | |
Public Member Functions inherited from llvm::MemoryObject | |
| virtual | ~MemoryObject () |
Interface to data which is actually streamed from a DataStreamer.
In addition to inherited members, it has the dropLeadingBytes and setKnownObjectSize methods which are not applicable to non-streamed objects.
Definition at line 25 of file StreamingMemoryObject.h.
| llvm::StreamingMemoryObject::StreamingMemoryObject | ( | std::unique_ptr< DataStreamer > | Streamer | ) |
Definition at line 126 of file StreamingMemoryObject.cpp.
| bool llvm::StreamingMemoryObject::dropLeadingBytes | ( | size_t | s | ) |
Drop s bytes from the front of the stream, pushing the positions of the remaining bytes down by s.
This is used to skip past the bitcode header, since we don't know a priori if it's present, and we can't put bytes back into the stream once we've read them.
Definition at line 107 of file StreamingMemoryObject.cpp.
|
overridevirtual |
Returns the size of the region in bytes.
(The region is contiguous, so the highest valid address of the region is getExtent() - 1).
Implements llvm::MemoryObject.
Definition at line 79 of file StreamingMemoryObject.cpp.
|
inlineoverridevirtual |
Ensures that the requested data is in memory, and returns a pointer to it.
More efficient than using readBytes if the data is already in memory. May block until (address - base + size) bytes have been read
| address | - address of the byte, in the same space as getBase() |
| size | - amount of data that must be available on return |
Implements llvm::MemoryObject.
Definition at line 31 of file StreamingMemoryObject.h.
References llvm::report_fatal_error().
|
overridevirtual |
Returns true if the address is within the object (i.e.
between base and base + extent - 1 inclusive). May block until (address - base) bytes have been read
| address | - address of the byte, in the same space as getBase() |
Implements llvm::MemoryObject.
Definition at line 74 of file StreamingMemoryObject.cpp.
|
overridevirtual |
Tries to read a contiguous range of bytes from the region, up to the end of the region.
| Buf | - A pointer to a buffer to be filled in. Must be non-NULL and large enough to hold size bytes. |
| Size | - The number of bytes to copy. |
| Address | - The address of the first byte, in the same space as getBase(). |
Implements llvm::MemoryObject.
Definition at line 87 of file StreamingMemoryObject.cpp.
References llvm::dwarf::syntax::Address.
| void llvm::StreamingMemoryObject::setKnownObjectSize | ( | size_t | size | ) |
If the data object size is known in advance, many of the operations can be made more efficient, so this method should be called before reading starts (although it can be called anytime).
Definition at line 114 of file StreamingMemoryObject.cpp.
References size.
1.8.6