[PATCH] D18551: Added Fixer implementation and fix() interface in clang-format for removing redundant code.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 31 02:05:33 PDT 2016


ioeric added inline comments.

================
Comment at: include/clang/Format/Format.h:813
@@ +812,3 @@
+/// Otherwise identical to the reformat() function using a file ID.
+tooling::Replacements fix(const FormatStyle &Style, StringRef Code,
+                          ArrayRef<tooling::Range> Ranges,
----------------
I am adding reformatting after fixing, and I am wondering if we can get rid of the Style parameter here (since the style does not really matter in code fixing, I think?) and let the reformat handling the style with the use case like:

```
FinalReplaces = formatReplacements(Code, fixReplacements(Code, Replaces), Style);
```
where `fixReplacements` is a function parallel to `formatReplacements`. 


http://reviews.llvm.org/D18551





More information about the cfe-commits mailing list