This is an archive of the discontinued LLVM Phabricator instance.

[Support] Add FormatVariadic support for chrono types
ClosedPublic

Authored by labath on Feb 2 2017, 5:48 PM.

Details

Summary

The formatter has three knobs:

  • the user can choose which time unit to use for formatting (default: whatever is the unit of the input)
  • he can choose whether the unit gets displayed (default: yes)
  • he can affect the way the number itself is formatted via standard number formatting options (default:default)

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Feb 2 2017, 5:48 PM
zturner added inline comments.Feb 3 2017, 1:49 PM
include/llvm/Support/Chrono.h
70 ↗(On Diff #86929)

Shouldn't the output here be 1,000? The presence of - suggests that the unit should not be displayed.

109 ↗(On Diff #86929)

consumeUnit?

127 ↗(On Diff #86929)

consumeShowUnit?

labath updated this revision to Diff 87026.Feb 3 2017, 2:23 PM

Address review comments.

labath marked 2 inline comments as done.Feb 3 2017, 2:24 PM
labath added inline comments.
include/llvm/Support/Chrono.h
70 ↗(On Diff #86929)

Indeed it should. Thanks for catching this.

labath added a comment.Feb 7 2017, 9:15 AM

Is there anything else you wanted me to do here?

zturner accepted this revision.Feb 7 2017, 9:18 AM
This revision is now accepted and ready to land.Feb 7 2017, 9:18 AM
This revision was automatically updated to reflect the committed changes.