Fix a leak that I introduced in r14729: FrontendOptions does not own input

buffers, so undo 'unique_ptr'fication here


Swift SVN r14733
This commit is contained in:
Dmitri Hrybenko
2014-03-06 13:53:04 +00:00
parent d0fd7e48ee
commit 255b8e88c8
4 changed files with 6 additions and 6 deletions

View File

@@ -147,12 +147,11 @@ bool swift::CompilerInstance::setup(const CompilerInvocation &Invok) {
// Add the memory buffers first, these will be associated with a filename
// and they can replace the contents of an input filename.
for (unsigned i = 0, e = Invocation.getInputBuffers().size(); i != e; ++i) {
// CompilerInvocation doesn't own the buffers, copy to a new buffer.
auto Buf = Invocation.getInputBuffers()[i];
unsigned BufferID = SourceMgr.addNewSourceBuffer(
llvm::MemoryBuffer::getMemBufferCopy(Buf->getBuffer(),
Buf->getBufferIdentifier()));
// CompilerInvocation doesn't own the buffers, copy to a new buffer.
BufferIDs.push_back(BufferID);
if (SILMode)