mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-19 08:35:45 +00:00
Use the return of readBytes to find out if we are at the end of the stream.
This allows the removal of isObjectEnd and opens the way for reading 64 bits at a time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221804 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -34,9 +34,6 @@ public:
|
||||
bool isValidAddress(uint64_t address) const override {
|
||||
return validAddress(address);
|
||||
}
|
||||
bool isObjectEnd(uint64_t address) const override {
|
||||
return objectEnd(address);
|
||||
}
|
||||
|
||||
private:
|
||||
const uint8_t* const FirstChar;
|
||||
@@ -47,9 +44,6 @@ private:
|
||||
bool validAddress(uint64_t address) const {
|
||||
return static_cast<std::ptrdiff_t>(address) < LastChar - FirstChar;
|
||||
}
|
||||
bool objectEnd(uint64_t address) const {
|
||||
return static_cast<std::ptrdiff_t>(address) == LastChar - FirstChar;
|
||||
}
|
||||
|
||||
RawMemoryObject(const RawMemoryObject&) LLVM_DELETED_FUNCTION;
|
||||
void operator=(const RawMemoryObject&) LLVM_DELETED_FUNCTION;
|
||||
@@ -85,12 +79,6 @@ bool StreamingMemoryObject::isValidAddress(uint64_t address) const {
|
||||
return fetchToPos(address);
|
||||
}
|
||||
|
||||
bool StreamingMemoryObject::isObjectEnd(uint64_t address) const {
|
||||
if (ObjectSize) return address == ObjectSize;
|
||||
fetchToPos(address);
|
||||
return address == ObjectSize && address != 0;
|
||||
}
|
||||
|
||||
uint64_t StreamingMemoryObject::getExtent() const {
|
||||
if (ObjectSize) return ObjectSize;
|
||||
size_t pos = BytesRead + kChunkSize;
|
||||
|
||||
Reference in New Issue
Block a user