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;
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=")) {
// 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);
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);