Remove InstId::Builtin members (#4632)

- `InstId::Builtin<Inst>` -> `<Inst>::SingletonInstId`
- `InstId::PackageNamespace` -> `Namespace::PackageInstId`
This commit is contained in:
Jon Ross-Perkins
2024-12-05 18:13:46 +00:00
committed by GitHub
parent d79d9e0884
commit efab39cbd9
38 changed files with 131 additions and 150 deletions
+5 -5
View File
@@ -124,8 +124,8 @@ auto MatchContext::DoWork(Context& context) -> SemIR::InstBlockId {
auto MatchContext::EmitPatternMatch(Context& context,
MatchContext::WorkItem entry) -> void {
if (entry.pattern_id == SemIR::InstId::BuiltinErrorInst) {
results_.push_back(SemIR::InstId::BuiltinErrorInst);
if (entry.pattern_id == SemIR::ErrorInst::SingletonInstId) {
results_.push_back(SemIR::ErrorInst::SingletonInstId);
return;
}
DiagnosticAnnotationScope annotate_diagnostics(
@@ -182,7 +182,7 @@ auto MatchContext::EmitPatternMatch(Context& context,
context.emitter().Emit(
TokenOnly(context.insts().GetLocId(entry.scrutinee_id)),
AddrSelfIsNonRef);
results_.push_back(SemIR::InstId::BuiltinErrorInst);
results_.push_back(SemIR::ErrorInst::SingletonInstId);
return;
}
auto scrutinee_ref = context.insts().Get(scrutinee_ref_id);
@@ -203,8 +203,8 @@ auto MatchContext::EmitPatternMatch(Context& context,
switch (kind_) {
case MatchKind::Caller: {
CARBON_CHECK(entry.scrutinee_id.is_valid());
if (entry.scrutinee_id == SemIR::InstId::BuiltinErrorInst) {
results_.push_back(SemIR::InstId::BuiltinErrorInst);
if (entry.scrutinee_id == SemIR::ErrorInst::SingletonInstId) {
results_.push_back(SemIR::ErrorInst::SingletonInstId);
} else {
results_.push_back(ConvertToValueOfType(
context, context.insts().GetLocId(entry.scrutinee_id),