1 //===- MemoryObject.cpp - Abstract memory interface -----------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/Support/MemoryObject.h"
13 MemoryObject::~MemoryObject() {
16 int MemoryObject::readBytes(uint64_t address,
19 uint64_t current = address;
20 uint64_t limit = getBase() + getExtent();
22 if (current + size > limit)
25 while (current - address < size) {
26 if (readByte(current, &buf[(current - address)]))