This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Fix temp file dumping, enable via llvm-lto and test it
ClosedPublic

Authored by tejohnson on Aug 15 2016, 2:51 PM.

Details

Summary

Fixed a bug in ThinLTOCodeGenerator's temp file dumping. The Twine
needs to be passed directly as an argument, not saved.

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.

Diff Detail

Repository
rL LLVM

Event Timeline

tejohnson updated this revision to Diff 68083.Aug 15 2016, 2:51 PM
tejohnson retitled this revision from to [ThinLTO] Fix temp file dumping, enable via llvm-lto and test it.
tejohnson updated this object.
tejohnson added a reviewer: mehdi_amini.
tejohnson added a subscriber: llvm-commits.
mehdi_amini edited edge metadata.Aug 15 2016, 2:55 PM

It doesn't seem there are any consumers of this

I noticed this last week looking at the coverage report on llvm.org. Thanks for adding this!

lib/LTO/ThinLTOCodeGenerator.cpp
81 ↗(On Diff #68083)

Damn auto...

82 ↗(On Diff #68083)

To avoid the code duplication, can we keep the SaveTempPath but declared as follows?

std::string SaveTempPath = (TempDir + llvm::utostr(count) + Suffix).str();
83 ↗(On Diff #68083)

I probably added the .str() here to fix a compile error, it should have hinted me that something was wrong!

mehdi_amini accepted this revision.Aug 15 2016, 2:55 PM
mehdi_amini edited edge metadata.

(LGTM of course)

This revision is now accepted and ready to land.Aug 15 2016, 2:55 PM
tejohnson added inline comments.Aug 15 2016, 4:32 PM
lib/LTO/ThinLTOCodeGenerator.cpp
82 ↗(On Diff #68083)

Yep, done. Will commit version with that change.

This revision was automatically updated to reflect the committed changes.