diff options
| author | Rui Ueyama <ruiu@google.com> | 2014-12-12 10:27:33 +0000 | 
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2014-12-12 10:27:33 +0000 | 
| commit | 961f43fb70f65a2697f67c6857587608a888e6cb (patch) | |
| tree | 65cfb4deeb6eed7c6705ebee605de30173cdb968 /llvm/unittests/Support/FileOutputBufferTest.cpp | |
| parent | 11a0ac66e10658f9eec87db0e846f6f5eaafc9cf (diff) | |
| download | llvm-961f43fb70f65a2697f67c6857587608a888e6cb.zip llvm-961f43fb70f65a2697f67c6857587608a888e6cb.tar.gz llvm-961f43fb70f65a2697f67c6857587608a888e6cb.tar.bz2  | |
Make File always take the ownership of a MemoryBuffer.
The documentation of parseFile() said that "the resulting File
object may take ownership of the MemoryBuffer." So, whether or not
the ownership of a MemoryBuffer would be taken was not clear.
A FileNode (a subclass of InputElement, which is being deprecated)
keeps the ownership if a File doesn't take it.
This patch makes File always take the ownership of a buffer.
Buffers lifespan is not always the same as File instances.
Files are able to deallocate buffers after parsing the contents.
llvm-svn: 224113
Diffstat (limited to 'llvm/unittests/Support/FileOutputBufferTest.cpp')
0 files changed, 0 insertions, 0 deletions
