In this diff, I've replaced the individual implementation of JSONWriter with json::OStream provided by llvm/Support/JSON.h.
Important Note: The output format of the JSON is considerably different compared to the original implementation. Important differences include:
- New line for each entry in an array (should make diffs cleaner)
- No space between keys and colon in attributed object entries.
- Attributes with empty strings will now print the attribute name and a quote pair rather than excluding the attribute altogether
Examples of these differences can be seen in the changes to the sancov tests which compare the JSON output.
Patch by Douglas Gliner.