The -invert-pointer-binding option will be superseeded by my next
cfe-commit. Instead of explicitly overwriting this flag, clang-format
can then be configured to auto-detect certain style-options based on the
input file.
llvm-svn: 174503
Apparently the owners of the tools we want to integrate with (eclipse in
this case) don't have JSON parsers.
The output now is:
<replacements>
<replacement offset='2' length='3'> </replacement>
...
</replacements>
Kicking JSON for now - it's easy enough to get back in when we need it.
FIXME: once we find this useful enough, we might want to add it as
free-standing functions to tooling.
llvm-svn: 174497
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
This is backwards compatible with earlier integrations.
Also adds a basic test and a test for the ranges integration.
You can now run:
clang-format -offset=42 -length=15 -offset=150 -length=22
To re-format the ranges (42, +15) and (150, +22).
llvm-svn: 174378
- adds '-h' as an alias for '-help'.
- adds an optional <file> argument
- adds an option -i to in-place edit the given file
- adds a help text to explain what the tool does
llvm-svn: 171858
This matches the test change done in clang at r171742. Without this,
clang-format would strip '@' characters and format e.g. '@interface' as
'interface'.
llvm-svn: 171743
A segfault used to clear the entire buffer. With this change, a message
to report a bug is displayed instead.
This should solve most cases similar to llvm.org/PR14774.
llvm-svn: 171480
We should also install the clang-format.py script somewhere that makes
since for a Vim integration script. I don't know where that is though,
so just installing the binary for now. This is enough to let me use the
script from a checkout combined with the installed (and thus less likely
to crash or be slow) clang-format binary.
llvm-svn: 171164
Reads a single source range (offset, length) as well as the style guide
as parameters and then reformats everything it receives from stdin.
llvm-svn: 169364