Remove BitcodeReader::setBufferOwned.

We do have use cases for the bitcode reader owning the buffer or not, but we
always know which one we have when we construct it.

It might be possible to simplify this further, but this is a step in the
right direction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211205 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-06-18 18:55:41 +00:00
parent ec2d823329
commit cc21bbde87
3 changed files with 12 additions and 23 deletions

View File

@ -223,11 +223,11 @@ public:
return std::error_code(E, BitcodeErrorCategory());
}
explicit BitcodeReader(MemoryBuffer *buffer, LLVMContext &C)
: Context(C), TheModule(nullptr), Buffer(buffer), BufferOwned(false),
LazyStreamer(nullptr), NextUnreadBit(0), SeenValueSymbolTable(false),
ValueList(C), MDValueList(C), SeenFirstFunctionBody(false),
UseRelativeIDs(false) {}
explicit BitcodeReader(MemoryBuffer *buffer, LLVMContext &C, bool BufferOwned)
: Context(C), TheModule(nullptr), Buffer(buffer),
BufferOwned(BufferOwned), LazyStreamer(nullptr), NextUnreadBit(0),
SeenValueSymbolTable(false), ValueList(C), MDValueList(C),
SeenFirstFunctionBody(false), UseRelativeIDs(false) {}
explicit BitcodeReader(DataStreamer *streamer, LLVMContext &C)
: Context(C), TheModule(nullptr), Buffer(nullptr), BufferOwned(false),
LazyStreamer(streamer), NextUnreadBit(0), SeenValueSymbolTable(false),
@ -239,10 +239,6 @@ public:
void FreeState();
/// setBufferOwned - If this is true, the reader will destroy the MemoryBuffer
/// when the reader is destroyed.
void setBufferOwned(bool Owned) { BufferOwned = Owned; }
bool isMaterializable(const GlobalValue *GV) const override;
bool isDematerializable(const GlobalValue *GV) const override;
std::error_code Materialize(GlobalValue *GV) override;