Remove offsets from InstId formatting, trying to name more #4645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The offsets were originally added to deal with churn from builtins in the raw semir. In textual semir, we mostly see instruction IDs for imports, and builtins have also settled down more.
On imports, where possible, use the
EntityNameId
for an import instead of printing an instruction. Next, show the source location if we have a node. Only show the instruction if there's no location.This also exposes
Parse::Tree
andTokenizedBuffer
, so that we can pass aSemIR::File
without the component parts. In particular this allows us to get theTokenizedBuffer
for import IRs without substantial structural modifications. We may want to make these optional for serializedSemIR
later, but the nodes/tokens contain source location, which we'd need for debug information -- so it's not clear how much we can really make them optional without substantial information loss.Reduce arguments to just
File
in a few spots, as a result of the accompanyingTokenizedBuffer
andParse::Tree
. Also updates style to pass aroundconst File*
where the reference is maintained, instead ofconst File&
.I was considering keeping a direct reference to the tree and tokens on
Context
, but initially my thought was it wouldn't make much difference. I can re-add those if desired, just as direct caching of theFile
fields.