[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 06:26:10 PDT 2016


ioeric added inline comments.

================
Comment at: lib/Format/Format.cpp:1551
@@ +1550,3 @@
+    return Replaces;
+  tooling::Replacements HeaderInsertionReplaces;
+  tooling::Replacements NewReplaces;
----------------
djasper wrote:
> Why do you split out all the header insertion replacements here instead of just ignoring the ones that aren't header insertions in fixCppIncludeInsertions?
I think this enables us to exit early in `fixCppIncludeInsertions` if there is no header insertion replacement at all. Also, it is easier to split out header insertion replacements and then merge fixed replacements with other replacements instead of doing this in place, which IMO might not be more efficient since there are still set deletion and insertion for each header insertion replacement.


http://reviews.llvm.org/D20734





More information about the cfe-commits mailing list