Commit 3848831
committed
[SourceLocation] Extract and rework line tables
* `computeLines` now produces newly introducded 'SourceLineTable'.
* `SourceLineTable` is factored out line tables and source location
directive info from `SourceLocationConverter`.
* In the future, the compiler shoud only use `SourceLineTable` instead
of `SourceLocationConverter` because its SourceManager already know
the file name, and the whole source buffer.
* `forEachLineLength` is now `forEachEndOfLine` which emits the
absolution position of each end-of-lne, instead of the line length.
* `#sourceLocation` info are now handled differently. Specifically,
while traversing the syntax tree, it only collects the raw syntax,
then post-process those info to produce the newly introduced
`VirtualFile`. `VirtualFile` is a type that have enough infomation for
`swift::SourceMamanger` in the compiler.1 parent 1cd3534 commit 3848831
1 file changed
+390
-239
lines changed
0 commit comments