mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 09:34:42 +01:00
Move import refs to their own block. (#4103)
This executes on a TODO in AddImportRef to add instructions to their own block instead of the File block. This has an important consequence of removing a pattern from InstBlockStack that added to blocks not currently at the top, cleaning up an issue for ArrayStack. The delta here is then mostly in different formatting of the import refs, a consequence of the separation.
This commit is contained in:
@@ -633,6 +633,19 @@ auto Context::is_current_position_reachable() -> bool {
|
||||
SemIR::TerminatorKind::Terminator;
|
||||
}
|
||||
|
||||
auto Context::Finalize() -> void {
|
||||
// Pop information for the file-level scope.
|
||||
sem_ir().set_top_inst_block_id(inst_block_stack().Pop());
|
||||
scope_stack().Pop();
|
||||
|
||||
// Finalizes the list of exports on the IR.
|
||||
inst_blocks().Set(SemIR::InstBlockId::Exports, exports_);
|
||||
// Finalizes the ImportRef inst block.
|
||||
inst_blocks().Set(SemIR::InstBlockId::ImportRefs, import_ref_ids_);
|
||||
// Finalizes __global_init.
|
||||
global_init_.Finalize();
|
||||
}
|
||||
|
||||
namespace {
|
||||
// Worklist-based type completion mechanism.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user