This is an archive of the discontinued LLVM Phabricator instance.

Modernize and clean-up the Predicate class
ClosedPublic

Authored by labath on May 8 2018, 6:31 AM.

Details

Summary

The comments on this class were out of date with the implementation, and
the implementation itself was inconsistent with our usage of the Timeout
class (I started converting everything to use this class back in D27136,
but I missed this one). I avoid duplicating the waiting logic by
introducing a templated WaitFor function, and make other functions
delegate to that. This function can be also used as a replacement for
the unused WaitForBitToBeSet functions I removed, if it turns out to be
necessary.

As this changes the meaning of a "zero" timeout, I tracked down all the
callers of these functions and updated them accordingly. Propagating the
changes to all the callers of RunShellCommand was a bit too much for
this patch, so I stopped there and will continue that in a follow-up
patch.

I also add some basic unittests for the functions I modified.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.May 8 2018, 6:31 AM
clayborg accepted this revision.May 8 2018, 9:18 AM

Looks great!

This revision is now accepted and ready to land.May 8 2018, 9:18 AM
This revision was automatically updated to reflect the committed changes.