[PATCH] D46209: [Support] Make JSON handle doubles and int64s losslessly

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 27 13:18:24 PDT 2018


sammccall created this revision.
sammccall added a reviewer: simon_tatham.
Herald added a subscriber: llvm-commits.

This patch adds a new "integer" ValueType, and renames Number -> Double.
This allows us to preserve the full precision of int64_t when parsing integers
from the wire, or constructing from an integer.
The API is unchanged, other than giving asInteger() a clearer contract.

In addition, always output doubles with enough precision that parsing will
reconstruct the same double.


Repository:
  rL LLVM

https://reviews.llvm.org/D46209

Files:
  include/llvm/Support/JSON.h
  lib/Support/JSON.cpp
  unittests/Support/JSONTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46209.144390.patch
Type: text/x-patch
Size: 8465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180427/ddb2e920/attachment.bin>


More information about the llvm-commits mailing list