Revert changes to LTO test case since llvm-lto can't handle textual IR inputs
[oota-llvm.git] / lib / Support / StreamingMemoryObject.cpp
index f0eb83153e0cc7e4d7754abb2a40fc0778cfb4f3..90f3ed80d126f22289a13b1b0c5452449c7a3425 100644 (file)
@@ -8,12 +8,9 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Support/StreamingMemoryObject.h"
-#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <cstring>
-
-
 using namespace llvm;
 
 namespace {
@@ -45,8 +42,8 @@ private:
     return static_cast<std::ptrdiff_t>(address) < LastChar - FirstChar;
   }
 
-  RawMemoryObject(const RawMemoryObject&) LLVM_DELETED_FUNCTION;
-  void operator=(const RawMemoryObject&) LLVM_DELETED_FUNCTION;
+  RawMemoryObject(const RawMemoryObject&) = delete;
+  void operator=(const RawMemoryObject&) = delete;
 };
 
 uint64_t RawMemoryObject::readBytes(uint8_t *Buf, uint64_t Size,
@@ -59,9 +56,9 @@ uint64_t RawMemoryObject::readBytes(uint8_t *Buf, uint64_t Size,
   if (End > BufferSize)
     End = BufferSize;
 
+  assert(static_cast<int64_t>(End - Address) >= 0);
   Size = End - Address;
-  assert(Size >= 0);
-  memcpy(Buf, (uint8_t *)(Address + FirstChar), Size);
+  memcpy(Buf, Address + FirstChar, Size);
   return Size;
 }
 
@@ -96,8 +93,8 @@ uint64_t StreamingMemoryObject::readBytes(uint8_t *Buf, uint64_t Size,
   uint64_t End = Address + Size;
   if (End > BytesRead)
     End = BytesRead;
+  assert(static_cast<int64_t>(End - Address) >= 0);
   Size = End - Address;
-  assert(Size >= 0);
   memcpy(Buf, &Bytes[Address + BytesSkipped], Size);
   return Size;
 }