mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-15 02:18:32 +00: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:
1 parent
4261bb2dd2
commit
96c7cfe41c
6 files changed
+77
-93
No files matched your search
@@ -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