Support: Allow use of MemoryBufferRef with line_iterator
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 12 Oct 2020 22:00:55 +0000 (18:00 -0400)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 13 Oct 2020 20:43:49 +0000 (16:43 -0400)
commitf2b7d9f7faa2788e362a91761a1624fb6b020851
tree3bd80f40344d9c51e9353e2ba687643ce4f733e1
parentf0875971249b59b5a4c07cedc9633f0359cf6b73
Support: Allow use of MemoryBufferRef with line_iterator

Split out from https://reviews.llvm.org/D66782, use `Optional<MemoryBufferRef>`
in `line_iterator` so you don't need access to a `MemoryBuffer*`.  Follow up
patches in `clang/` will leverage this.

Differential Revision: https://reviews.llvm.org/D89280
llvm/include/llvm/Support/LineIterator.h
llvm/lib/Support/LineIterator.cpp
llvm/unittests/Support/LineIteratorTest.cpp