[PATCH] D15909: [llvm-symbolizer] -print-source-context-lines option to print source code around the line.

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 8 15:06:48 PST 2016


samsonov accepted this revision.
samsonov added a comment.
This revision is now accepted and ready to land.

LGTM (but switch to `line_iterator` if it's convenient).


================
Comment at: lib/DebugInfo/Symbolize/DIPrinter.cpp:46
@@ +45,3 @@
+  for (uint32_t I = 0; LineStart != StringRef::npos && I <= LastLine; ++I) {
+    size_t LineEnd = FileContent.find_first_of("\n", LineStart);
+    if (I + 1 >= FirstLine && I < LastLine) {
----------------
Can you use `include/llvm/Support/LineIterator.h` instead of splitting file manually?


http://reviews.llvm.org/D15909





More information about the llvm-commits mailing list