Add lexing for dump-sem-ir-start and end (#5357)

Syntax rationale is on `DumpSemIRRange` to try and record this, since
I'm not sure this belongs in the language design. The intent of this is
to be able to subset SemIR, which will be done separately in the
formatter.

---------

Co-authored-by: David Blaikie <dblaikie@gmail.com>
This commit is contained in:
Jon Ross-PerkinsandDavid Blaikie authored and GitHub committed 2025-04-24 22:17:04 +00:00
1 parent fb39e3c569
commit a342e5c117
5 files changed
+262 -20

No files matched your search

+8
View File
@@ -236,6 +236,14 @@ auto TokenizedBuffer::Print(llvm::raw_ostream& output_stream,
PrintToken(output_stream, token, widths);
output_stream << "\n";
}
if (!dump_sem_ir_ranges_.empty()) {
output_stream << " dump_sem_ir_ranges:\n";
for (auto range : dump_sem_ir_ranges_) {
output_stream << " - {start: " << range.start.index
<< ", end: " << range.end.index << "}\n";
}
}
}
auto TokenizedBuffer::PrintToken(llvm::raw_ostream& output_stream,