[lld] r331699 - Rename Config::ThinLTOIndexOnlyObjectFiles -> Config::ThinLTOIndexOnlyArg.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon May 7 16:24:16 PDT 2018
Author: ruiu
Date: Mon May 7 16:24:16 2018
New Revision: 331699
URL: http://llvm.org/viewvc/llvm-project?rev=331699&view=rev
Log:
Rename Config::ThinLTOIndexOnlyObjectFiles -> Config::ThinLTOIndexOnlyArg.
Modified:
lld/trunk/ELF/Config.h
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/LTO.cpp
Modified: lld/trunk/ELF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Config.h?rev=331699&r1=331698&r2=331699&view=diff
==============================================================================
--- lld/trunk/ELF/Config.h (original)
+++ lld/trunk/ELF/Config.h Mon May 7 16:24:16 2018
@@ -94,7 +94,7 @@ struct Configuration {
llvm::StringRef SoName;
llvm::StringRef Sysroot;
llvm::StringRef ThinLTOCacheDir;
- llvm::StringRef ThinLTOIndexOnlyObjectsFile;
+ llvm::StringRef ThinLTOIndexOnlyArg;
std::pair<llvm::StringRef, llvm::StringRef> ThinLTOPrefixReplace;
std::string Rpath;
std::vector<VersionDefinition> VersionDefinitions;
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=331699&r1=331698&r2=331699&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Mon May 7 16:24:16 2018
@@ -800,7 +800,7 @@ void LinkerDriver::readConfigs(opt::Inpu
Config->ThinLTOIndexOnly = true;
} else if (S.startswith("thinlto-index-only=")) {
Config->ThinLTOIndexOnly = true;
- Config->ThinLTOIndexOnlyObjectsFile = S.substr(19);
+ Config->ThinLTOIndexOnlyArg = S.substr(19);
} else if (S == "thinlto-emit-imports-files") {
Config->ThinLTOEmitImportsFiles = true;
} else if (S.startswith("thinlto-prefix-replace=")) {
Modified: lld/trunk/ELF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.cpp?rev=331699&r1=331698&r2=331699&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.cpp (original)
+++ lld/trunk/ELF/LTO.cpp Mon May 7 16:24:16 2018
@@ -70,9 +70,6 @@ static void checkError(Error E) {
// Creates an empty file to store a list of object files for final
// linking of distributed ThinLTO.
static std::unique_ptr<raw_fd_ostream> openFile(StringRef File) {
- if (File.empty())
- return nullptr;
-
std::error_code EC;
auto Ret =
llvm::make_unique<raw_fd_ostream>(File, EC, sys::fs::OpenFlags::F_None);
@@ -136,7 +133,10 @@ BitcodeCompiler::BitcodeCompiler() {
lto::ThinBackend Backend;
if (Config->ThinLTOIndexOnly) {
- IndexFile = openFile(Config->ThinLTOIndexOnlyObjectsFile);
+ StringRef Path = Config->ThinLTOIndexOnlyArg;
+ if (!Path.empty())
+ IndexFile = openFile(Path);
+
Backend = lto::createWriteIndexesThinBackend(
Config->ThinLTOPrefixReplace.first, Config->ThinLTOPrefixReplace.second,
Config->ThinLTOEmitImportsFiles, IndexFile.get(), nullptr);
More information about the llvm-commits
mailing list