This is an archive of the discontinued LLVM Phabricator instance.

[find-all-symbols] Fix racy yaml file writing.
ClosedPublic

Authored by bkramer on Apr 29 2016, 3:14 AM.

Details

Summary

If multiple find-all-symbols processes access the temporary directory
simultaneously with two files with the same name they would collide and
create a broken yaml file. Fix this by using the safe createUniqueFile
API from LLVM instead.

Diff Detail

Repository
rL LLVM

Event Timeline

bkramer updated this revision to Diff 55559.Apr 29 2016, 3:14 AM
bkramer retitled this revision from to [find-all-symbols] Fix racy yaml file writing..
bkramer updated this object.
bkramer added a reviewer: hokein.
bkramer added a subscriber: cfe-commits.
hokein accepted this revision.Apr 29 2016, 3:20 AM
hokein edited edge metadata.

Thanks! LGTM with one nit.

include-fixer/find-all-symbols/SymbolInfo.h
92 ↗(On Diff #55559)

It would be better to change the function name to WriteSymbolInfosToStream.

This revision is now accepted and ready to land.Apr 29 2016, 3:20 AM
This revision was automatically updated to reflect the committed changes.