Support, LTO: When pruning a directory, ignore files not matching a prefix.
ClosedPublic

Authored by pcc on Fri, Mar 17, 4:25 PM.

Details

Summary

This is a safeguard against data loss if the user specifies a directory
that is not a cache directory. Teach the existing cache pruning clients
to create files with appropriate names.

Diff Detail

Repository
rL LLVM
pcc created this revision.Fri, Mar 17, 4:25 PM

Generally, looks good, modulo the comment.

llvm/lib/Support/CachePruning.cpp
193 ↗(On Diff #92223)

We should just ignore files not created by LLVM. If a user decided to put something there, then she has a reason. And there's no actual harm to our code, if these files exist but ignored.

pcc updated this revision to Diff 92243.Fri, Mar 17, 7:44 PM
pcc marked an inline comment as done.
  • Address review comments
llvm/lib/Support/CachePruning.cpp
193 ↗(On Diff #92223)

Makes sense, done.

pcc retitled this revision from Support, LTO: Error out when pruning a directory containing files not matching a prefix. to Support, LTO: When pruning a directory, ignore files not matching a prefix..Fri, Mar 17, 7:44 PM
krasin accepted this revision.Mon, Mar 20, 9:00 AM

Thank you, Peter!

This revision is now accepted and ready to land.Mon, Mar 20, 9:00 AM
This revision was automatically updated to reflect the committed changes.