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:
Geoff Romer
2026-04-17 19:03:21 +00:00
committed by GitHub
parent f91990aa87
commit ad0a4ea8a4
4 changed files with 62 additions and 56 deletions
+2 -1
View File
@@ -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;