diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-08-18 00:12:33 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-08-18 00:12:33 +0000 |
commit | eccffada338fe084676876138b2e5e183d708757 (patch) | |
tree | 6345d72788f7e4b081d914b4789ac3fb39d251e0 /llvm/lib/LTO/LTOBackend.cpp | |
parent | 1fb2ecc9030c288fcbe32bca11c1b5a07414c13c (diff) | |
download | llvm-eccffada338fe084676876138b2e5e183d708757.zip llvm-eccffada338fe084676876138b2e5e183d708757.tar.gz llvm-eccffada338fe084676876138b2e5e183d708757.tar.bz2 |
[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
llvm-svn: 279014
Diffstat (limited to 'llvm/lib/LTO/LTOBackend.cpp')
-rw-r--r-- | llvm/lib/LTO/LTOBackend.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp index e80aa7b..ddd0a6d 100644 --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -40,7 +40,7 @@ Error Config::addSaveTemps(std::string OutputFileName, std::error_code EC; ResolutionFile = llvm::make_unique<raw_fd_ostream>( - 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) { |