aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/StreamingMemoryObject.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-11-12 18:37:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-11-12 18:37:00 +0000
commit0c9aa57a0767b053276270e997f22952d2f15924 (patch)
tree623135d0f1179180360ec6dc55d74c73bb9ae00c /llvm/lib/Support/StreamingMemoryObject.cpp
parent98a3ec010a2094a01e31fc086674577b5adba0d3 (diff)
downloadllvm-0c9aa57a0767b053276270e997f22952d2f15924.zip
llvm-0c9aa57a0767b053276270e997f22952d2f15924.tar.gz
llvm-0c9aa57a0767b053276270e997f22952d2f15924.tar.bz2
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. llvm-svn: 221804
Diffstat (limited to 'llvm/lib/Support/StreamingMemoryObject.cpp')
-rw-r--r--llvm/lib/Support/StreamingMemoryObject.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/llvm/lib/Support/StreamingMemoryObject.cpp b/llvm/lib/Support/StreamingMemoryObject.cpp
index 8884a94..b3723d0 100644
--- a/llvm/lib/Support/StreamingMemoryObject.cpp
+++ b/llvm/lib/Support/StreamingMemoryObject.cpp
@@ -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;