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* copied
) const {
20 uint64_t current
= address
;
21 uint64_t limit
= getBase() + getExtent();
23 while (current
- address
< size
&& current
< limit
) {
24 if (readByte(current
, &buf
[(current
- address
)]))
31 *copied
= current
- address
;