Remove temoprary files.
authorRui Ueyama <ruiu@google.com>
Fri, 2 Sep 2016 17:34:17 +0000 (17:34 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 2 Sep 2016 17:34:17 +0000 (17:34 +0000)
commitfa12b8bd1a8ddb82c7337f9a9a7b5acf193a239b
tree215b56c16da059e2f01491fedfe972655c4c358b
parent31b88cb030fab7b35720c78798e7efff1596187a
Remove temoprary files.

Previously, we created temporary files using llvm::sys::fs::createTemporaryFile
and removed them using llvm::FileRemover. This is error-prone as it is easy to
forget creating FileRemover instances after creating temporary files.
There is actually a temporary file leak bug.

This patch introduces a new class, TemporaryFile, to manage temporary files
in the RAII style.

Differential Revision: https://reviews.llvm.org/D24176

llvm-svn: 280510
lld/COFF/DriverUtils.cpp