mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(minifier): rename ast_passes to peephole (#8635)
This commit is contained in:
parent
891a9c2040
commit
dcc1f2bcb3
13 changed files with 7 additions and 8 deletions
|
|
@ -4,7 +4,7 @@ use oxc_semantic::{ScopeTree, SemanticBuilder, SymbolTable};
|
||||||
use oxc_traverse::ReusableTraverseCtx;
|
use oxc_traverse::ReusableTraverseCtx;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
ast_passes::{DeadCodeElimination, Normalize, NormalizeOptions, PeepholeOptimizations},
|
peephole::{DeadCodeElimination, Normalize, NormalizeOptions, PeepholeOptimizations},
|
||||||
CompressOptions,
|
CompressOptions,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -31,7 +31,6 @@ impl<'a> Compressor<'a> {
|
||||||
program: &mut Program<'a>,
|
program: &mut Program<'a>,
|
||||||
) {
|
) {
|
||||||
let mut ctx = ReusableTraverseCtx::new(scopes, symbols, self.allocator);
|
let mut ctx = ReusableTraverseCtx::new(scopes, symbols, self.allocator);
|
||||||
// RemoveUnusedCode::new(self.options).build(program, &mut ctx);
|
|
||||||
let normalize_options = NormalizeOptions { convert_while_to_fors: true };
|
let normalize_options = NormalizeOptions { convert_while_to_fors: true };
|
||||||
Normalize::new(normalize_options, self.options).build(program, &mut ctx);
|
Normalize::new(normalize_options, self.options).build(program, &mut ctx);
|
||||||
PeepholeOptimizations::new(self.options.target, true).run_in_loop(program, &mut ctx);
|
PeepholeOptimizations::new(self.options.target, true).run_in_loop(program, &mut ctx);
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
//! ECMAScript Minifier
|
//! ECMAScript Minifier
|
||||||
|
|
||||||
mod ast_passes;
|
|
||||||
mod compressor;
|
mod compressor;
|
||||||
mod ctx;
|
mod ctx;
|
||||||
mod keep_var;
|
mod keep_var;
|
||||||
mod options;
|
mod options;
|
||||||
|
mod peephole;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tester;
|
mod tester;
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,14 @@ use oxc_traverse::{traverse_mut_with_ctx, ReusableTraverseCtx, Traverse, Travers
|
||||||
|
|
||||||
mod collapse_variable_declarations;
|
mod collapse_variable_declarations;
|
||||||
mod convert_to_dotted_properties;
|
mod convert_to_dotted_properties;
|
||||||
|
mod fold_constants;
|
||||||
|
mod minimize_conditions;
|
||||||
mod minimize_exit_points;
|
mod minimize_exit_points;
|
||||||
mod normalize;
|
mod normalize;
|
||||||
mod peephole_fold_constants;
|
mod remove_dead_code;
|
||||||
mod peephole_minimize_conditions;
|
mod replace_known_methods;
|
||||||
mod peephole_remove_dead_code;
|
|
||||||
mod peephole_replace_known_methods;
|
|
||||||
mod peephole_substitute_alternate_syntax;
|
|
||||||
mod statement_fusion;
|
mod statement_fusion;
|
||||||
|
mod substitute_alternate_syntax;
|
||||||
|
|
||||||
pub use normalize::{Normalize, NormalizeOptions};
|
pub use normalize::{Normalize, NormalizeOptions};
|
||||||
|
|
||||||
Loading…
Reference in a new issue