mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Emit VarStorages eagerly (#7468)
We used to have to batch these at the end of pattern traversal in order to avoid accidentally adding them to a block that was speculatively pushed for an expression within a pattern, but that's no longer a concern with the more precise handling of those speculative blocks in #7445.
This commit is contained in:
@@ -30,6 +30,7 @@ auto FullPatternStack::StartPatternInitializer() -> void {
|
||||
std::swap(lookup_result.back().inst_id, inst_id);
|
||||
}
|
||||
}
|
||||
next_var_index_stack_.back() = 0;
|
||||
}
|
||||
|
||||
auto FullPatternStack::EndPatternInitializer() -> void {
|
||||
@@ -46,13 +47,4 @@ auto FullPatternStack::EndPatternInitializer() -> void {
|
||||
}
|
||||
}
|
||||
|
||||
auto FullPatternStack::BuildLocalVarStorage(Context& context,
|
||||
bool is_returned_var) -> void {
|
||||
for (auto& var_info : var_pattern_stack_.PeekArray()) {
|
||||
var_info.storage_id =
|
||||
GetOrAddVarStorage(context, var_info.pattern_id, is_returned_var);
|
||||
}
|
||||
next_var_index_stack_.back() = 0;
|
||||
}
|
||||
|
||||
} // namespace Carbon::Check
|
||||
|
||||
Reference in New Issue
Block a user