-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2049 from fzyzcjy/feat/12183
Refactor to extract early_generator between high-level intermediate representation and mid-level intermediate representation
- Loading branch information
Showing
19 changed files
with
147 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
frb_codegen/src/library/codegen/parser/early_generator/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
pub(crate) mod trait_impl_enum; | ||
|
||
use crate::codegen::dumper::Dumper; | ||
use crate::codegen::ir::hir::flat::pack::HirFlatPack; | ||
use crate::codegen::parser::hir::flat::extra_code_injector::inject_extra_code; | ||
use crate::codegen::parser::hir::internal_config::ParserHirInternalConfig; | ||
use crate::codegen::parser::mir; | ||
use crate::codegen::parser::mir::internal_config::ParserMirInternalConfig; | ||
|
||
pub(crate) fn execute( | ||
mut pack: HirFlatPack, | ||
config_mir: &ParserMirInternalConfig, | ||
dumper: &Dumper, | ||
) -> anyhow::Result<HirFlatPack> { | ||
let dumper_tentative_mir = dumper.with_add_name_prefix("tentative_mir/"); | ||
let tentative_mir_pack = mir::parse(config_mir, &pack, &dumper_tentative_mir)?; | ||
|
||
let extra_code = trait_impl_enum::generate(&pack, &tentative_mir_pack)?; | ||
|
||
inject_extra_code( | ||
&mut pack, | ||
&extra_code, | ||
&(config_mir.rust_input_namespace_pack).rust_output_path_namespace, | ||
)?; | ||
|
||
Ok(pack) | ||
} |
24 changes: 8 additions & 16 deletions
24
...r/generate_trait_impl_enum_transformer.rs → ...parser/early_generator/trait_impl_enum.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.