Merge StreamableMemoryObject into MemoryObject.

Every MemoryObject is a StreamableMemoryObject since the removal of
StringRefMemoryObject, so just merge the two.

I will clean up the MemoryObject interface in the upcoming commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221766 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-11-12 03:55:46 +00:00
parent 64f62a02e0
commit d0518569ec
6 changed files with 51 additions and 63 deletions

View File

@ -17,7 +17,7 @@
#include "llvm/Bitcode/BitCodes.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/StreamableMemoryObject.h"
#include "llvm/Support/StreamingMemoryObject.h"
#include <climits>
#include <string>
#include <vector>
@ -42,7 +42,7 @@ public:
std::vector<std::pair<unsigned, std::string> > RecordNames;
};
private:
std::unique_ptr<StreamableMemoryObject> BitcodeBytes;
std::unique_ptr<MemoryObject> BitcodeBytes;
std::vector<BlockInfo> BlockInfoRecords;
@ -61,7 +61,7 @@ public:
init(Start, End);
}
BitstreamReader(StreamableMemoryObject *bytes) : IgnoreBlockInfoNames(true) {
BitstreamReader(MemoryObject *bytes) : IgnoreBlockInfoNames(true) {
BitcodeBytes.reset(bytes);
}
@ -82,7 +82,7 @@ public:
BitcodeBytes.reset(getNonStreamedMemoryObject(Start, End));
}
StreamableMemoryObject &getBitcodeBytes() { return *BitcodeBytes; }
MemoryObject &getBitcodeBytes() { return *BitcodeBytes; }
/// This is called by clients that want block/record name information.
void CollectBlockInfoNames() { IgnoreBlockInfoNames = false; }