diff options
| author | Teresa Johnson <tejohnson@google.com> | 2016-08-15 23:24:57 +0000 |
|---|---|---|
| committer | Teresa Johnson <tejohnson@google.com> | 2016-08-15 23:24:57 +0000 |
| commit | c44a12244f3855660d8244152eb40da4d853289e (patch) | |
| tree | 0716d21a1408f7f424b546fa7bbaf34eb763c6e9 /llvm/lib/LTO | |
| parent | 6b7d8c294429c25e225b87769e4381659dc3bbb0 (diff) | |
| download | bcm5719-llvm-c44a12244f3855660d8244152eb40da4d853289e.tar.gz bcm5719-llvm-c44a12244f3855660d8244152eb40da4d853289e.zip | |
[ThinLTO] Fix temp file dumping, enable via llvm-lto and test it
Summary:
Fixed a bug in ThinLTOCodeGenerator's temp file dumping. The Twine
needs to be passed directly as an argument, or a copy saved into a
std::string.
It doesn't seem there are any consumers of this, so I added a new option
to llvm-lto to enable saving of temp files during ThinLTO, and augmented
a test to use it to check post-import but pre-opt bitcode.
Reviewers: mehdi_amini
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D23525
llvm-svn: 278761
Diffstat (limited to 'llvm/lib/LTO')
| -rw-r--r-- | llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp index bfb0980bc16..9224f726cd9 100644 --- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp @@ -78,9 +78,9 @@ static void saveTempBitcode(const Module &TheModule, StringRef TempDir, if (TempDir.empty()) return; // User asked to save temps, let dump the bitcode file after import. - auto SaveTempPath = TempDir + llvm::utostr(count) + Suffix; + std::string SaveTempPath = (TempDir + llvm::utostr(count) + Suffix).str(); std::error_code EC; - raw_fd_ostream OS(SaveTempPath.str(), EC, sys::fs::F_None); + raw_fd_ostream OS(SaveTempPath, EC, sys::fs::F_None); if (EC) report_fatal_error(Twine("Failed to open ") + SaveTempPath + " to save optimized bitcode\n"); |

