[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
Thu Jan 7 16:37:58 PST 2016


samsonov added inline comments.

================
Comment at: tools/llvm-symbolizer/llvm-symbolizer.cpp:218
@@ +217,3 @@
+      if (DebugInfo.getNumberOfFrames() > 0) {
+        for (uint32_t I = 0; I < DebugInfo.getNumberOfFrames(); ++I) {
+          const auto &Frame = DebugInfo.getFrame(I);
----------------
So, what are the drawbacks of printing source file contents from `DIPrinter`? We changed llvm-symbolizer to be agnostic of the way `DILineInfo` / `DIInliningInfo` is represented: and pass it directly from producer to printer, and now we return to manually writing all these loops.

Keeping that in DIPrinter would also let you write unit tests for that functionality, if needed.


http://reviews.llvm.org/D15909





More information about the llvm-commits mailing list