mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Change ImplWitnessTablePlaceholder from instruction to InstId value (#6294)
`ImplWitnessTablePlaceholder` is the only non-type singleton instruction (`ErrorInst` is a type; while `ImplWitnessTablePlaceholder` exposes `TypeInstId`, it's only used as an `InstId`). In order to allow simpler handling of singleton instructions, replace `ImplWitnessTablePlaceholder::TypeInstId` uses with `InstId::ImplWitnessTablePlaceholder`. Since the placeholder instruction was never evaluated, this has no significant effect on behavior. --------- Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
co-authored by
Dana Jansens
parent
93dc369ebd
commit
a1fd86cf27
@@ -141,7 +141,7 @@ auto ImplWitnessStartDefinition(Context& context, SemIR::Impl& impl) -> void {
|
||||
CARBON_CHECK(decl_id.has_value(), "Non-constant associated entity");
|
||||
if (auto decl =
|
||||
context.insts().TryGetAs<SemIR::AssociatedConstantDecl>(decl_id)) {
|
||||
if (witness_value == SemIR::ImplWitnessTablePlaceholder::TypeInstId) {
|
||||
if (witness_value == SemIR::InstId::ImplWitnessTablePlaceholder) {
|
||||
CARBON_DIAGNOSTIC(ImplAssociatedConstantNeedsValue, Error,
|
||||
"associated constant {0} not given a value in impl "
|
||||
"of interface {1}",
|
||||
@@ -252,7 +252,7 @@ auto FillImplWitnessWithErrors(Context& context, SemIR::Impl& impl) -> void {
|
||||
auto witness_block =
|
||||
context.inst_blocks().GetMutable(witness_table.elements_id);
|
||||
for (auto& elem : witness_block) {
|
||||
if (elem == SemIR::ImplWitnessTablePlaceholder::TypeInstId) {
|
||||
if (elem == SemIR::InstId::ImplWitnessTablePlaceholder) {
|
||||
elem = SemIR::ErrorInst::InstId;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user