mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
I think the name of `SemIRLoc` might be leading to a few suggestions to use it for non-diagnostic purposes that I've been responding to. At the same time, a short name seems desirable given its frequency of use for diagnostics. I did also clean up misuse in #4857, and eval.cpp (noted below) might be similar. We don't typically use `friend` to emphasize relationships, but given the diagnostic-specific intent and ways it's been used, perhaps it's reasonable to close the API of this type using `friend`? eval.cpp inspects contents, but it's not clear that's needed because changing logic doesn't affect tests, so I'm just removing it. Note that SemIRLoc could've also been a loc_id, and it seems like the current approach would mishandle that (i.e., print for `LocId::None` when that seems not to be the intent). I figure we can add a `has_value` or `AddNoteRequiringLoc` or something like that if needed.