This is an archive of the discontinued LLVM Phabricator instance.

Use TempFile in dsymutil
ClosedPublic

Authored by rafael on Nov 15 2017, 4:42 PM.

Details

Reviewers
JDevlieghere
Summary

I don't think there is any functionality change, but the code is easier to understand IMHO.

Diff Detail

Event Timeline

rafael created this revision.Nov 15 2017, 4:42 PM
JDevlieghere added inline comments.Nov 16 2017, 2:53 AM
tools/dsymutil/dsymutil.cpp
217

How about wrapping this in a small RAII class? Without the need to run the interrupt handler we can get rid of exitDsymutil.

322

Can we extract the temp-file logic into a separate function that returns a Expected<sys::fs::TempFile>?

324

s/dysym/dsym/

370

My suggestion would require us to keep a vector of futures. Thinking about it, that also solves the problem of one thread calling exitDsymutil and removing temp files while another thread is still writing to them.

Remove exitDsymutil.

JDevlieghere added inline comments.Nov 16 2017, 11:52 AM
tools/dsymutil/dsymutil.cpp
324

What do you think about moving the vector into the RAII object?

Move the vector to the RAII object.

JDevlieghere accepted this revision.Nov 17 2017, 1:35 AM

Thanks Rafael, LGTM!

This revision is now accepted and ready to land.Nov 17 2017, 1:35 AM