[Driver] Don't open files multiple times.

llvm-svn: 178268
This commit is contained in:
Michael J. Spencer 2013-03-28 18:58:35 +00:00
parent e00e6f23d3
commit 1067ff61e6
1 changed files with 1 additions and 2 deletions

View File

@ -66,8 +66,7 @@ void LinkerInvocation::operator()() {
}
std::vector<std::unique_ptr<File>> files;
if (llvm::error_code ec = reader->readFile(
buffer->getBufferIdentifier(), files)) {
if (llvm::error_code ec = reader->parseFile(std::unique_ptr<MemoryBuffer>(MemoryBuffer::getMemBuffer(buffer->getBuffer(), buffer->getBufferIdentifier())), files)) {
llvm::errs() << "Failed to read file: " << input.getPath() << ": "
<< ec.message() << "\n";
return;