From d2bd9e70b16db88a7808ee2280b0a107afbfdd3b Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 23 Oct 2019 17:52:45 +0000 Subject: Vendor import of stripped lld trunk r375505, the last commit before the upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/lld/trunk@375505 --- COFF/LTO.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'COFF/LTO.cpp') diff --git a/COFF/LTO.cpp b/COFF/LTO.cpp index eb3c60d66077..1c21236dce2b 100644 --- a/COFF/LTO.cpp +++ b/COFF/LTO.cpp @@ -39,14 +39,14 @@ using namespace llvm; using namespace llvm::object; -using namespace lld; -using namespace lld::coff; +namespace lld { +namespace coff { // Creates an empty file to and returns a raw_fd_ostream to write to it. static std::unique_ptr openFile(StringRef file) { std::error_code ec; auto ret = - llvm::make_unique(file, ec, sys::fs::OpenFlags::F_None); + std::make_unique(file, ec, sys::fs::OpenFlags::OF_None); if (ec) { error("cannot open " + file + ": " + ec.message()); return nullptr; @@ -105,7 +105,7 @@ BitcodeCompiler::BitcodeCompiler() { backend = lto::createInProcessThinBackend(config->thinLTOJobs); } - ltoObj = llvm::make_unique(createConfig(), backend, + ltoObj = std::make_unique(createConfig(), backend, config->ltoPartitions); } @@ -160,8 +160,8 @@ std::vector BitcodeCompiler::compile() { checkError(ltoObj->run( [&](size_t task) { - return llvm::make_unique( - llvm::make_unique(buf[task])); + return std::make_unique( + std::make_unique(buf[task])); }, cache)); @@ -177,6 +177,8 @@ std::vector BitcodeCompiler::compile() { // files. After that, we exit from linker and ThinLTO backend runs in a // distributed environment. if (config->thinLTOIndexOnly) { + if (!config->ltoObjPath.empty()) + saveBuffer(buf[0], config->ltoObjPath); if (indexFile) indexFile->close(); return {}; @@ -204,3 +206,6 @@ std::vector BitcodeCompiler::compile() { return ret; } + +} // namespace coff +} // namespace lld -- cgit v1.2.3