mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:10:12 +01:00
Delete the GetConstantValue overload for AbsoluteInstId (#5145)
This prevents conversion from an InstId which is its base class, and documents that this is invalid in the code. Also expand the comment on the AbsoluteInstBlockId, which I had locally but seem to have not saved and included in #5141. --------- Co-authored-by: josh11b <15258583+josh11b@users.noreply.github.com>
This commit is contained in:
@@ -348,6 +348,12 @@ static auto MakeFacetTypeResult(Context& context,
|
||||
// with constant phase, and if so, returns the corresponding constant value.
|
||||
// Overloads are provided for different kinds of ID.
|
||||
|
||||
// AbsoluteInstId can not have its values substituted, so this overload is
|
||||
// deleted. This prevents conversion to InstId.
|
||||
static auto GetConstantValue(EvalContext& eval_context,
|
||||
SemIR::AbsoluteInstId inst_id, Phase* phase)
|
||||
-> SemIR::InstId = delete;
|
||||
|
||||
// If the given instruction is constant, returns its constant value.
|
||||
static auto GetConstantValue(EvalContext& eval_context, SemIR::InstId inst_id,
|
||||
Phase* phase) -> SemIR::InstId {
|
||||
@@ -375,7 +381,8 @@ static auto GetConstantValue(EvalContext& eval_context, SemIR::TypeId type_id,
|
||||
return eval_context.context().types().GetTypeIdForTypeConstantId(const_id);
|
||||
}
|
||||
|
||||
// AbsoluteInstBlockId can not have its values substituted.
|
||||
// AbsoluteInstBlockId can not have its values substituted, so this overload is
|
||||
// deleted. This prevents conversion to InstBlockId.
|
||||
static auto GetConstantValue(EvalContext& eval_context,
|
||||
SemIR::AbsoluteInstBlockId inst_block_id,
|
||||
Phase* phase) -> SemIR::InstBlockId = delete;
|
||||
|
||||
Reference in New Issue
Block a user