Return the number of read bytes in MemoryObject::readBytes.

Returning more information will allow BitstreamReader to be simplified a bit
and changed to read 64 bits at a time.

llvm-svn: 221794
This commit is contained in:
Rafael Espindola
2014-11-12 17:11:16 +00:00
parent 606e4f69b8
commit 9b65f4ede9
5 changed files with 38 additions and 24 deletions
+1 -1
View File
@@ -3430,7 +3430,7 @@ std::error_code BitcodeReader::InitLazyStream() {
Stream.init(&*StreamFile);
unsigned char buf[16];
if (Bytes->readBytes(0, 16, buf) == -1)
if (Bytes->readBytes(buf, 16, 0) != 16)
return Error(BitcodeError::InvalidBitcodeSignature);
if (!isBitcode(buf, buf + 16))