mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:21:21 +01:00
Add an EvalOrAddInst function. (#5258)
Use that instead of `AddInstInNoBlock` to get the value of an instruction when evaluation might depend on the `InstId` but only the `ConstantId` of the instruction is desired by the consumer.
This commit is contained in:
@@ -1744,7 +1744,8 @@ static auto TryEvalTypedInst(EvalContext& eval_context, SemIR::InstId inst_id,
|
||||
// Couldn't perform the action because it's still dependent.
|
||||
return MakeConstantResult(eval_context.context(), inst,
|
||||
Phase::TemplateSymbolic);
|
||||
} else if constexpr (InstT::Kind.constant_needs_inst_id()) {
|
||||
} else if constexpr (InstT::Kind.constant_needs_inst_id() !=
|
||||
SemIR::InstConstantNeedsInstIdKind::No) {
|
||||
CARBON_CHECK(inst_id.has_value());
|
||||
return ConvertEvalResultToConstantId(
|
||||
eval_context.context(),
|
||||
|
||||
Reference in New Issue
Block a user