mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add a verifier that SemIR is in SSA form. (#7771)
Check that every use of a non-constant instruction is dominated by a definition of that instruction. Remove the fake (instruction creation order based) dominance checks in convert; these start spuriously failing during template instantiation of initializers. Assisted-by: Claude Opus 5 via Antigravity
This commit is contained in:
@@ -2543,14 +2543,6 @@ auto InitializeExisting(Context& context, SemIR::LocId loc_id,
|
||||
storage_id = SemIR::InstId::None;
|
||||
}
|
||||
|
||||
// TODO: This is only an approximation of a dominance check. Add a general
|
||||
// end-of-phase dominance check and remove the check here and the one in
|
||||
// `MergeReplacing`.
|
||||
CARBON_CHECK(!storage_id.has_value() ||
|
||||
value_id == SemIR::ErrorInst::InstId ||
|
||||
context.insts().GetRawIndex(storage_id) <=
|
||||
context.insts().GetRawIndex(value_id),
|
||||
"Storage might not dominate initializer");
|
||||
PendingBlock target_block(&context);
|
||||
return Convert(context, loc_id, value_id,
|
||||
{.kind = ConversionTarget::Initializing,
|
||||
|
||||
Reference in New Issue
Block a user