//===----------------------------------------------------------------------===//
#include "llvm/Support/StreamingMemoryObject.h"
-#include "llvm/Support/Compiler.h"
#include <cassert>
#include <cstddef>
#include <cstring>
-
-
using namespace llvm;
namespace {
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,
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;
}
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;
}