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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217960 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Bogner
2014-09-17 15:43:01 +00:00
parent 27608d8393
commit 0a277ea23d
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,