Return the number of read bytes in MemoryObject::readBytes.
[oota-llvm.git] / include / llvm / Support / MemoryObject.h
index 584a2c55c04005d84f19928dc12b82eac84339b8..f031a127ce64043a7e7055833339d3e26c1a0471 100644 (file)
@@ -36,18 +36,16 @@ public:
   virtual uint64_t getExtent() const = 0;
 
   /// Tries to read a contiguous range of bytes from the region, up to the end
-  /// of the region. You should override this function if there is a quicker way
-  /// than going back and forth with individual bytes.
+  /// of the region.
   ///
   /// @param address  - The address of the first byte, in the same space as
   ///                   getBase().
   /// @param size     - The number of bytes to copy.
   /// @param buf      - A pointer to a buffer to be filled in.  Must be non-NULL
   ///                   and large enough to hold size bytes.
-  /// @result         - 0 if successful; -1 if not.  Failure may be due to a
-  ///                   bounds violation or an implementation-specific error.
-  virtual int readBytes(uint64_t address, uint64_t size,
-                        uint8_t *buf) const = 0;
+  /// @result         - The number of bytes read.
+  virtual uint64_t readBytes(uint8_t *Buf, uint64_t Size,
+                             uint64_t Address) const = 0;
 
   /// Ensures that the requested data is in memory, and returns a pointer to it.
   /// More efficient than using readBytes if the data is already in memory. May