Adds JSON output for replacements, to simplify tools integration.
authorManuel Klimek <klimek@google.com>
Tue, 5 Feb 2013 15:52:21 +0000 (15:52 +0000)
committerManuel Klimek <klimek@google.com>
Tue, 5 Feb 2013 15:52:21 +0000 (15:52 +0000)
commit65bdeae121db423d7e33c158229ec2e9a70f0c4c
tree5a77f1a4263373ffb34e6c8743b8177b7c396c61
parent2c6cf8e2c7d659e7c3a2332b13cba6b1f1baacac
Adds JSON output for replacements, to simplify tools integration.

Using -output-replacements will now output the replacements instead
of the changed code. This allows easier integration with tools that
need full control over what changed.

The format is an array of objects with the members "offset" (number),
"length" (number) and "replacement_text" (string), for example:

[
  {
    "offset": 42,
    "length": 5,
    "replacement_text": "  "
  },
  {
    "offset": 105,
    "length": 4,
    "replacement_text": ""
  }
]

llvm-svn: 174382
clang-tools-extra/clang-format/ClangFormat.cpp