| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ | |||
| 12 | 12 | use crate::{ | |
| 13 | 13 | IndexMap, IndexSet, ToPythonName, | |
| 14 | 14 | error::{CodegenError, CodegenErrorType, InternalError, PatternUnreachableReason}, | |
| 15 | - ir::{self, BlockIdx}, | ||
| 15 | + ir::{self, Block, BlockIdx, Blocks}, | ||
| 16 | 16 | preprocess, | |
| 17 | 17 | symboltable::{self, CompilerScope, Symbol, SymbolFlags, SymbolScope, SymbolTable}, | |
| 18 | 18 | unparse::UnparseExpr, | |
@@ -470,7 +470,7 @@ impl Compiler { | |||
| 470 | 470 | flags: CodeFlags::empty(), | |
| 471 | 471 | source_path: source_file.name().to_owned(), | |
| 472 | 472 | private: None, | |
| 473 | - blocks: vec![ir::Block::default()], | ||
| 473 | + blocks: Blocks::from([Block::default()]), | ||
| 474 | 474 | current_block: BlockIdx::new(0), | |
| 475 | 475 | instr_sequence: ir::InstructionSequence::new(), | |
| 476 | 476 | instr_sequence_label_map: ir::InstructionSequenceLabelMap::new(), | |
@@ -547,8 +547,9 @@ impl Compiler { | |||
| 547 | 547 | saved_annotations_instr_sequence, | |
| 548 | 548 | ) = { | |
| 549 | 549 | let code = self.current_code_info(); | |
| 550 | + | ||
| 550 | 551 | ( | |
| 551 | - mem::replace(&mut code.blocks, vec![ir::Block::default()]), | ||
| 552 | + mem::replace(&mut code.blocks, Blocks::from([Block::default()])), | ||
| 552 | 553 | mem::replace(&mut code.current_block, BlockIdx::new(0)), | |
| 553 | 554 | mem::replace(&mut code.instr_sequence, ir::InstructionSequence::new()), | |
| 554 | 555 | mem::replace( | |
@@ -1348,7 +1349,7 @@ impl Compiler { | |||
| 1348 | 1349 | flags, | |
| 1349 | 1350 | source_path, | |
| 1350 | 1351 | private, | |
| 1351 | - blocks: vec![ir::Block::default()], | ||
| 1352 | + blocks: Blocks::from([Block::default()]), | ||
| 1352 | 1353 | current_block: BlockIdx::new(0), | |
| 1353 | 1354 | instr_sequence: ir::InstructionSequence::new(), | |
| 1354 | 1355 | instr_sequence_label_map: ir::InstructionSequenceLabelMap::new(), | |
@@ -10983,7 +10984,7 @@ impl Compiler { | |||
| 10983 | 10984 | unwrap_internal(self, result); | |
| 10984 | 10985 | let code = self.current_code_info(); | |
| 10985 | 10986 | let idx = BlockIdx::new(code.blocks.len().to_u32()); | |
| 10986 | - code.blocks.push(ir::Block::default()); | ||
| 10987 | + code.blocks.push(Block::default()); | ||
| 10987 | 10988 | let result = code.push_unmapped_instr_sequence_label(); | |
| 10988 | 10989 | unwrap_internal(self, result); | |
| 10989 | 10990 | idx | |
@@ -10998,7 +10999,7 @@ impl Compiler { | |||
| 10998 | 10999 | unwrap_internal(self, result); | |
| 10999 | 11000 | let code = self.current_code_info(); | |
| 11000 | 11001 | let idx = BlockIdx::new(code.blocks.len().to_u32()); | |
| 11001 | - code.blocks.push(ir::Block::default()); | ||
| 11002 | + code.blocks.push(Block::default()); | ||
| 11002 | 11003 | let result = code.push_unlabeled_instr_sequence_block(); | |
| 11003 | 11004 | unwrap_internal(self, result); | |
| 11004 | 11005 | idx | |
| Back | FazBrowse Home | New Git URL |
0 commit comments