Add some comments explaining what MVT and EVT are, and how they differ.
[oota-llvm.git] / include / llvm / System / Memory.h
index 136dc8a32895a105a658690d03827dbcc59fe33a..2dd36e8ab14796430dcea2173923c0c684142cd9 100644 (file)
@@ -14,6 +14,7 @@
 #ifndef LLVM_SYSTEM_MEMORY_H
 #define LLVM_SYSTEM_MEMORY_H
 
+#include "llvm/System/DataTypes.h"
 #include <string>
 
 namespace llvm {
@@ -26,11 +27,13 @@ namespace sys {
   /// @brief Memory block abstraction.
   class MemoryBlock {
   public:
+    MemoryBlock() : Address(0), Size(0) { }
+    MemoryBlock(void *addr, size_t size) : Address(addr), Size(size) { }
     void *base() const { return Address; }
-    unsigned size() const { return Size; }
+    size_t size() const { return Size; }
   private:
     void *Address;    ///< Address of first byte of memory area
-    unsigned Size;    ///< Size, in bytes of the memory area
+    size_t Size;      ///< Size, in bytes of the memory area
     friend class Memory;
   };
 
@@ -50,7 +53,7 @@ namespace sys {
     /// a null memory block and fills in *ErrMsg.
     /// 
     /// @brief Allocate Read/Write/Execute memory.
-    static MemoryBlock AllocateRWX(unsigned NumBytes,
+    static MemoryBlock AllocateRWX(size_t NumBytes,
                                    const MemoryBlock *NearBlock,
                                    std::string *ErrMsg = 0);
 
@@ -60,7 +63,6 @@ namespace sys {
     ///
     /// On success, this returns false, otherwise it returns true and fills
     /// in *ErrMsg.
-    /// @throws std::string if an error occurred.
     /// @brief Release Read/Write/Execute memory.
     static bool ReleaseRWX(MemoryBlock &block, std::string *ErrMsg = 0);