================
Comment at: tools/clang-format/ClangFormat.cpp:58
@@ +57,3 @@
+LineRanges("lines", cl::desc("<start line>:<end line> - format a range of\n"
+ "lines (both 1-based).\n"
+ "Multiple ranges can be formatted by specifying\n"
----------------
Might be worth making explicit that <end line> is included. E.g.:
"(both 1-based and included)"
================
Comment at: tools/clang-format/ClangFormat.cpp:188
@@ +187,3 @@
+// Returns true on error.
+static bool convertLinesToOffsets(StringRef FileContents) {
+ if (LineRanges.empty())
----------------
I'd strongly vote against converting to offset and length first (and especially
with our own implementation).
Use SourceManager::translateLineCol to get the corresponding SourceLocations in
the FileID (which you have after line 236) and convert them to CharSourceRanges
directly.
http://llvm-reviews.chandlerc.com/D1160
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits