Split IdentifierId and StringLiteralId from StringId (#3352)

Following up on discussion yesterday regarding this split.

Note, I'm expecting #3341 to do IdentifierId -> NameId in SemIR. It
might be worth adding NameId creation directly to StringStore if you're
content with this setup though.
This commit is contained in:
Jon Ross-Perkins
2023-11-02 18:44:32 +00:00
committed by GitHub
parent 7edfd8e02a
commit 3401eed8d8
30 changed files with 226 additions and 125 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ auto DeclarationNameStack::MakeEmptyNameContext() -> NameContext {
}
auto DeclarationNameStack::MakeUnqualifiedName(Parse::Node parse_node,
StringId name_id)
IdentifierId name_id)
-> NameContext {
NameContext context = MakeEmptyNameContext();
ApplyNameQualifierTo(context, parse_node, name_id);
@@ -86,13 +86,13 @@ auto DeclarationNameStack::AddNameToLookup(NameContext name_context,
}
auto DeclarationNameStack::ApplyNameQualifier(Parse::Node parse_node,
StringId name_id) -> void {
IdentifierId name_id) -> void {
ApplyNameQualifierTo(declaration_name_stack_.back(), parse_node, name_id);
}
auto DeclarationNameStack::ApplyNameQualifierTo(NameContext& name_context,
Parse::Node parse_node,
StringId name_id) -> void {
IdentifierId name_id) -> void {
if (CanResolveQualifier(name_context, parse_node)) {
// For identifier nodes, we need to perform a lookup on the identifier.
// This means the input instruction name_id is actually a string ID.