This is an archive of the discontinued LLVM Phabricator instance.

Directly write to a -Map file.
ClosedPublic

Authored by ruiu on Jan 13 2017, 4:58 PM.

Details

Summary

Previous code had a bug that if the program exits with an assert()
or fail() before the control reaches end of writeMapFile(), it left
a temporary file, because FileRemover's dtor didn't run.

I could fix that by removeFileOnSignal() and other functions, but
I think we can simply write to the result file directly. I think
that is straightforward and easy to understand.

Additionally, that allows something like -Map /dev/null or a bash
hack such as -Map >(grep -U symbol-im-looking-for). Previously,
that kind of things didn't work.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu updated this revision to Diff 84408.Jan 13 2017, 4:58 PM
ruiu retitled this revision from to Directly write to a -Map file..
ruiu updated this object.
ruiu added a reviewer: rafael.
ruiu added a subscriber: llvm-commits.
This revision was automatically updated to reflect the committed changes.