[PATCH] D11240: Add basic #include sorting functionality to clang-format

Daniel Jasper djasper at google.com
Tue Jul 21 06:48:47 PDT 2015


djasper added inline comments.

================
Comment at: tools/clang-format/ClangFormat.cpp:277
@@ +276,3 @@
+        std::error_code EC;
+        raw_fd_ostream FileOut(FileName, EC, llvm::sys::fs::F_Text);
+        if (EC) {
----------------
klimek wrote:
> djasper wrote:
> > That's exactly what the rewriter does. It simply doesn't help us at all in this case. Other than writing the file atomically, it only makes our life harder.
> > 
> > I think clang-format outputting the replacements in the order in which they need to applied makes sense and is significantly easier to integrate with than a two-phase run.
> I'll need to tinker with that myself, but that's not a blocker. I'm still unhappy with the interface though. I think having a list of replacements where you can't select a single one and apply it is a very subtle interface. Have you tested this with the eclipse / visual studio integration?
Oooo... I have a good idea to fix both of these things. Let me rewrite some stuff.


http://reviews.llvm.org/D11240







More information about the cfe-commits mailing list