Remove unused method. NFC.
[oota-llvm.git] / include / llvm / Support / MemoryObject.h
1 //===- MemoryObject.h - Abstract memory interface ---------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_SUPPORT_MEMORYOBJECT_H
11 #define LLVM_SUPPORT_MEMORYOBJECT_H
12
13 #include "llvm/Support/DataTypes.h"
14
15 namespace llvm {
16
17 /// MemoryObject - Abstract base class for contiguous addressable memory.
18 ///   Necessary for cases in which the memory is in another process, in a
19 ///   file, or on a remote machine.
20 ///   All size and offset parameters are uint64_ts, to allow 32-bit processes
21 ///   access to 64-bit address spaces.
22 class MemoryObject {
23 public:
24   /// Destructor      - Override as necessary.
25   virtual ~MemoryObject();
26
27   /// getExtent       - Returns the size of the region in bytes.  (The region is
28   ///                   contiguous, so the highest valid address of the region
29   ///                   is getBase() + getExtent() - 1).
30   ///
31   /// @result         - The size of the region.
32   virtual uint64_t getExtent() const = 0;
33
34   /// readBytes       - Tries to read a contiguous range of bytes from the
35   ///                   region, up to the end of the region.
36   ///                   You should override this function if there is a quicker
37   ///                   way than going back and forth with individual bytes.
38   ///
39   /// @param address  - The address of the first byte, in the same space as 
40   ///                   getBase().
41   /// @param size     - The number of bytes to copy.
42   /// @param buf      - A pointer to a buffer to be filled in.  Must be non-NULL
43   ///                   and large enough to hold size bytes.
44   /// @result         - 0 if successful; -1 if not.  Failure may be due to a
45   ///                   bounds violation or an implementation-specific error.
46   virtual int readBytes(uint64_t address, uint64_t size,
47                         uint8_t *buf) const = 0;
48 };
49
50 }
51
52 #endif