transpile: replace --reorganize-definitions/--disable-refactoring with --emit-refactor-annotations/--refactor#1640
Conversation
There was a problem hiding this comment.
--reorganize-definitions does not just enable annotations, it also changes the structure of the emitted code to include modules and cross-module imports (see generate_submodule_imports and the block labelled "Header Reorganization: Submodule Item Stores" in translator/mod.rs, which only has an effect when individual files' definition sets are tracked, a side effect of the reorganize_definitions bool). So while we should probably clarify the name, the new name shouldn't suggest that the flag is merely additive.
We could maybe split a separate boolean out to control the transpiler's submodule/header behavior, or use a name that clarifies that this is tied together with the reorganize-definitions annotations.
kkysen
left a comment
There was a problem hiding this comment.
--reorganize-definitionsdoes not just enable annotations, it also changes the structure of the emitted code to include modules and cross-module imports (seegenerate_submodule_importsand the block labelled "Header Reorganization: Submodule Item Stores" intranslator/mod.rs, which only has an effect when individual files' definition sets are tracked, a side effect of thereorganize_definitionsbool). So while we should probably clarify the name, the new name shouldn't suggest that the flag is merely additive.
Ahh. Why isn't this done always, then? I thought the reorganize_definitions transform is the one that replace duplicate definitions with cross-module imports.
We could maybe split a separate boolean out to control the transpiler's submodule/header behavior, or use a name that clarifies that this is tied together with the reorganize-definitions annotations.
What's a good name for this?
…nd `translate_valist` `reorganize_definitions` was removed, noted here: #1640 (comment), and `translate_valist` appears to be unused, too.
…nd `translate_valist` `reorganize_definitions` was removed (noted here: #1640 (comment)) and `translate_valist` appears to be unused, too.
… with `--emit-refactor-annotations`/`--refactor` Previously, `--reorganize-definitions` would emit annotations and run the refactor, with `--disable-refactoring` needed to only emit annotations. This simplifies things to additive flags. `--emit-refactor-annotations` only emits the annotations. `--refactor` implies `--emit-refactor-annotations` and runs the default refactor transforms.
5427bd8 to
7975eff
Compare
Previously,
--reorganize-definitionswould emit annotations and run the refactor, with--disable-refactoringneeded to only emit annotations. This simplifies things to additive flags.--emit-refactor-annotationsonly emits the annotations.--refactorimplies--emit-refactor-annotationsand runs the default refactor transforms.