- // Delete any ModuleProviders and ArchiveMember's we've allocated as a result
- // of symbol table searches.
+ // Delete any Modules and ArchiveMember's we've allocated as a result of
+ // symbol table searches.
llvm::GetBitcodeSymbols(const unsigned char *BufPtr, unsigned Length,
const std::string& ModuleID,
LLVMContext& Context,
std::vector<std::string>& symbols,
std::string* ErrMsg) {
llvm::GetBitcodeSymbols(const unsigned char *BufPtr, unsigned Length,
const std::string& ModuleID,
LLVMContext& Context,
std::vector<std::string>& symbols,
std::string* ErrMsg) {
- // Get the module provider
- MemoryBuffer *Buffer =MemoryBuffer::getNewMemBuffer(Length, ModuleID.c_str());
+ // Get the module.
+ std::auto_ptr<MemoryBuffer> Buffer(
+ MemoryBuffer::getNewMemBuffer(Length, ModuleID.c_str()));
- // Done with the module. Note that ModuleProvider will delete the
- // Module when it is deleted. Also note that its the caller's responsibility
- // to delete the ModuleProvider.
- return MP;
+ // Done with the module. Note that it's the caller's responsibility to delete
+ // the Module.
+ return M;