mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 11:01:05 +01:00
Restructure action-dependence APIs (#7074)
- Rename `ActionIsDependent` to `ActionIsPerformable` (with negated meaning), because that name is more concrete and, um, actionable. - Replace `OperandIsDependent` with `OperandDependence`, which returns a `ConstantDependence` instead of a bool. We need this additional generality for handling form actions, where we sometimes need to ask whether something has _any_ dependence, not just whether it has template dependence.
This commit is contained in:
@@ -545,7 +545,8 @@ static auto GetConstantValue(EvalContext& eval_context,
|
||||
}
|
||||
|
||||
// Otherwise, this is a normal instruction.
|
||||
if (OperandIsDependent(eval_context.context(), inst_id)) {
|
||||
if (OperandDependence(eval_context.context(), inst_id) ==
|
||||
SemIR::ConstantDependence::Template) {
|
||||
*phase = LatestPhase(*phase, Phase::TemplateSymbolic);
|
||||
}
|
||||
return inst_id;
|
||||
|
||||
Reference in New Issue
Block a user