This is an archive of the discontinued LLVM Phabricator instance.

[lto] Add saving the LTO .o file to -save-temps.
ClosedPublic

Authored by silvas on Mar 9 2016, 12:23 PM.

Details

Summary

This implements another part of -save-temps.
After this, the only remaining part is dumping the optimized bitcode. But
currently LLD's LTO doesn't have a non-intrusive place to put this.
Eventually we probably will and it will make sense to add it then.

After this patch, I have some NFC cleanups to make. I'll pull out a
maybeSaveTemp(std::string Suffix, std::function<void(raw_ostream &)>) and
simplify some of the names in the test.

Diff Detail

Repository
rL LLVM

Event Timeline

silvas updated this revision to Diff 50178.Mar 9 2016, 12:23 PM
silvas retitled this revision from to [lto] Add saving the LTO .o file to -save-temps..
silvas updated this object.
silvas added reviewers: ruiu, rafael.
silvas added subscribers: llvm-commits, Bigcheese.

I just checked and maybeSaveTemp is not a huge win for clarity.

ruiu accepted this revision.Mar 9 2016, 2:29 PM
ruiu edited edge metadata.

LGTM

test/ELF/lto/save-temps.ll
17–18 ↗(On Diff #50178)

s/CHECK-DAG/CHECK/g

I think this test currently don't do anything.

This revision is now accepted and ready to land.Mar 9 2016, 2:29 PM
This revision was automatically updated to reflect the committed changes.