From a53e50c418310231a915efb07131156c75669b78 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Thu, 18 Aug 2016 00:12:33 +0000 Subject: [LTO] Change addSaveTemps API: do not add dot to the supplied prefix path Summary: It does not play well with directories (end up with a bunch of hidden files). Also, do not strip the 0 suffix for the first task, especially since 0 can be used by ThinLTO as well now. Reviewers: tejohnson Subscribers: mehdi_amini, pcc, llvm-commits Differential Revision: https://reviews.llvm.org/D23612 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279014 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/LTO/LTOBackend.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/LTO/LTOBackend.cpp') diff --git a/lib/LTO/LTOBackend.cpp b/lib/LTO/LTOBackend.cpp index e80aa7b349a..ddd0a6d8e58 100644 --- a/lib/LTO/LTOBackend.cpp +++ b/lib/LTO/LTOBackend.cpp @@ -40,7 +40,7 @@ Error Config::addSaveTemps(std::string OutputFileName, std::error_code EC; ResolutionFile = llvm::make_unique( - OutputFileName + ".resolution.txt", EC, sys::fs::OpenFlags::F_Text); + OutputFileName + "resolution.txt", EC, sys::fs::OpenFlags::F_Text); if (EC) return errorCodeToError(EC); @@ -58,9 +58,7 @@ Error Config::addSaveTemps(std::string OutputFileName, // user hasn't requested using the input module's path, emit to a file // named from the provided OutputFileName with the Task ID appended. if (M.getModuleIdentifier() == "ld-temp.o" || !UseInputModulePath) { - PathPrefix = OutputFileName; - if (Task != 0) - PathPrefix += "." + utostr(Task); + PathPrefix = OutputFileName + utostr(Task); } else PathPrefix = M.getModuleIdentifier(); std::string Path = PathPrefix + "." + PathSuffix + ".bc"; @@ -86,7 +84,7 @@ Error Config::addSaveTemps(std::string OutputFileName, setHook("5.precodegen", PreCodeGenModuleHook); CombinedIndexHook = [=](const ModuleSummaryIndex &Index) { - std::string Path = OutputFileName + ".index.bc"; + std::string Path = OutputFileName + "index.bc"; std::error_code EC; raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::F_None); if (EC) { -- cgit v1.2.3