Merging CrossRef into ImportRefUsed, shifting builtins over. (#3659)

This is a bit of a cleanup; I probably should've just renamed CrossRef
instead of adding ImportRefUsed.

Adding `is_builtin` to InstId is more about providing a standard API for
the check, which I expect to add a little more of.

Shifts import tests to validate that the BuildValueRepr CHECK isn't
accidentally hit.
This commit is contained in:
Jon Ross-Perkins
2024-01-27 00:36:58 +00:00
committed by GitHub
parent 13de9e9d06
commit 8167c44a03
17 changed files with 116 additions and 95 deletions
+5 -3
View File
@@ -402,8 +402,8 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst)
// TODO: These need special handling.
case SemIR::BindValue::Kind:
case SemIR::Call::Kind:
case SemIR::CrossRef::Kind:
case SemIR::Deref::Kind:
case SemIR::ImportRefUsed::Kind:
case SemIR::Temporary::Kind:
case SemIR::TemporaryStorage::Kind:
case SemIR::ValueAsRef::Kind:
@@ -473,8 +473,6 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst)
case SemIR::BranchWithArg::Kind:
case SemIR::ClassDecl::Kind:
case SemIR::Import::Kind:
case SemIR::ImportRefUnused::Kind:
case SemIR::ImportRefUsed::Kind:
case SemIR::InterfaceDecl::Kind:
case SemIR::Param::Kind:
case SemIR::ReturnExpr::Kind:
@@ -483,6 +481,10 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst)
case SemIR::TupleLiteral::Kind:
case SemIR::VarStorage::Kind:
break;
case SemIR::ImportRefUnused::Kind:
CARBON_FATAL() << "ImportRefUnused should transform to ImportRefUsed "
"before TryEvalInst.";
}
return SemIR::ConstantId::NotConstant;
}