LineIterator: Provide a variant that keeps blank lines

It isn't always useful to skip blank lines, as evidenced by the
somewhat awkward use of line_iterator in llvm-cov. This adds a knob to
control whether or not to skip blanks.

llvm-svn: 217960
This commit is contained in:
Justin Bogner
2014-09-17 15:43:01 +00:00
parent 253e5da7ad
commit 69fe4e98fa
6 changed files with 117 additions and 29 deletions

View File

@@ -159,7 +159,7 @@ bool SampleProfileReader::loadText() {
return false;
}
MemoryBuffer &Buffer = *BufferOrErr.get();
line_iterator LineIt(Buffer, '#');
line_iterator LineIt(Buffer, /*SkipBlanks=*/true, '#');
// Read the profile of each function. Since each function may be
// mentioned more than once, and we are collecting flat profiles,