COFF: Make the Driver own all MemoryBuffers. NFC.
authorRui Ueyama <ruiu@google.com>
Sun, 31 May 2015 21:04:56 +0000 (21:04 +0000)
committerRui Ueyama <ruiu@google.com>
Sun, 31 May 2015 21:04:56 +0000 (21:04 +0000)
commitd7c2f5847af50181bba9b59dacf39cf19db9bfca
treea298852eda09a6a712e54c0a93ec7ff714addaef
parentfaa8bfdd1aa8bbaa02bd6e2adb8324180539af58
COFF: Make the Driver own all MemoryBuffers. NFC.

Previously, a MemoryBuffer of a file was owned by each InputFile object.
This patch makes the Driver own all of them. InputFiles now have only
MemoryBufferRefs. This change simplifies ownership managment
(particularly for ObjectFile -- the object owned a MemoryBuffer only when
it's not created from an archive file, because in that case a parent
archive file owned the entire buffer. Now it owns nothing unconditionally.)

llvm-svn: 238690
lld/COFF/Driver.cpp
lld/COFF/Driver.h
lld/COFF/InputFiles.cpp
lld/COFF/InputFiles.h
lld/COFF/Symbols.cpp