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 | a53e50c418310231a915efb07131156c75669b78 (patch) | |
tree | c16348f949459ffa35ed82150b509284e11f0905 /lib/LTO/LTOBackend.cpp | |
parent | 4ab1e666f8b116f3b2444d84a79543ac80851194 (diff) |
[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
Diffstat (limited to 'lib/LTO/LTOBackend.cpp')
-rw-r--r-- | lib/LTO/LTOBackend.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
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<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) { |