This is an archive of the discontinued LLVM Phabricator instance.

[Fixed Point Arithmetic] Fix for FixedPointValueToString
ClosedPublic

Authored by leonardchan on Jul 27 2018, 3:25 PM.

Details

Summary
  • Print negative numbers correctly
  • Handle APInts of different sizes
  • Add formal unit tests for FixedPointValueToString
  • Add tests for checking correct printing when padding is set
  • Restrict to printing in radix 10 since that's all we need for now

Diff Detail

Repository
rC Clang

Event Timeline

leonardchan created this revision.Jul 27 2018, 3:25 PM
leonardchan edited the summary of this revision. (Show Details)Jul 27 2018, 3:26 PM
ebevhan accepted this revision.Aug 6 2018, 1:09 AM

LGTM.

This revision is now accepted and ready to land.Aug 6 2018, 1:09 AM
ebevhan added inline comments.Aug 6 2018, 4:37 AM
lib/AST/Expr.cpp
788

Unrelated to this patch specifically, but using getZExtValue here is a bit limiting.

leonardchan marked an inline comment as done.Aug 6 2018, 8:53 AM
leonardchan added inline comments.
lib/AST/Expr.cpp
788

I'll make another small patch to change this since should also do signed values now,

This revision was automatically updated to reflect the committed changes.
leonardchan marked an inline comment as done.