[PATCH] D20734: [clang-format] insert new #includes into correct blocks when cleaning up Replacement with cleanupAroundReplacements().

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Mon May 30 11:47:28 PDT 2016


ioeric added inline comments.

================
Comment at: lib/Format/Format.cpp:1550
@@ +1549,3 @@
+// Insert #include directives into the correct blocks.
+tooling::Replacements fixHeaderInsertions(StringRef Code,
+                                          const tooling::Replacements &Replaces,
----------------
djasper wrote:
> Hm.. Not happy with the naming. There is no real difference between fixHeaderInsertions and fixCppIncludeInsertions. You could argue that the "Cpp" part is the difference, but the actual difference is that one iterates over an entire set of replacements whereas the other only modifies header insertions.
> 
> I think I'd just merge the two functions, but that probably also ties back to my wish not to separate out the two replacement sets ;-).
How about `fixInsertionReplacements`?


http://reviews.llvm.org/D20734





More information about the cfe-commits mailing list