1 //===- MemoryObject.cpp - Abstract memory interface -------------*- C++ -*-===//
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"
14 MemoryObject::~MemoryObject() {
17 int MemoryObject::readBytes(uint64_t address,
20 uint64_t* copied) const {
21 uint64_t current = address;
22 uint64_t limit = getBase() + getExtent();
24 while (current - address < size && current < limit) {
25 if (readByte(current, &buf[(current - address)]))
32 *copied = current - address;