mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user