<div dir="ltr">Looking at line_iterator, it seems to be designed to work with MemoryBuffer, which in turn seems specialized for dealing with file content (so while it may be possible to force init a MemoryBuffer from a StringRef it seems a bit awkward to me). Also, line_iterator has extra stuff which we don't need here yet requires extra care (skipping empty lines and comments, tracking line numbers...)<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 18, 2017 at 3:18 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><span class=""><div dir="ltr">On Mon, Sep 18, 2017 at 3:13 PM Leonard Mosescu <<a href="mailto:mosescu@google.com" target="_blank">mosescu@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It's a good question - here's a two part answer:<div><br></div><div>1. The actual printing of the output is the longest blocking in many cases (as mentioned in the description: the actual data gathering for "target module dump symtab" can take 1-2sec, but printing it can take 20min. For quick experiment, try dis -p -c 10000).</div><div>2. This change provides the scaffolding for cooperative interruption that can be used were appropriate, not just the printing part. I did this for "target" commands (see the changes in CommandObjectTarget.cpp), and it's very easy to do the same in other places as needed.</div><div><br></div></div></blockquote><div><br></div></span><div>Makes sense.  Can you try `llvm::line_iterator` then instead of the hand-splitting?  See `llvm/Support/LineIterator.h`</div></div></div>
</blockquote></div><br></div>