@@ -8,9 +8,7 @@ use std::{borrow::Cow, time::Instant};
8
8
use pretty_assertions:: assert_eq;
9
9
use swc_common:: pass:: { CompilerPass , Repeated } ;
10
10
use swc_ecma_ast:: * ;
11
- use swc_ecma_transforms_optimization:: simplify:: {
12
- dead_branch_remover, expr_simplifier, ExprSimplifierConfig ,
13
- } ;
11
+ use swc_ecma_transforms_optimization:: simplify:: { expr_simplifier, ExprSimplifierConfig } ;
14
12
use swc_ecma_usage_analyzer:: marks:: Marks ;
15
13
use swc_ecma_visit:: VisitMutWith ;
16
14
#[ cfg( debug_assertions) ]
@@ -250,40 +248,6 @@ impl Compressor<'_> {
250
248
// let done = dump(&*n);
251
249
// debug!("===== Result =====\n{}", done);
252
250
}
253
-
254
- if self . options . conditionals || self . options . dead_code {
255
- #[ cfg( feature = "debug" ) ]
256
- let start = dump ( & * n, false ) ;
257
-
258
- let start_time = now ( ) ;
259
-
260
- let mut v = dead_branch_remover ( self . marks . unresolved_mark ) ;
261
- n. visit_mut_with ( & mut v) ;
262
-
263
- if let Some ( start_time) = start_time {
264
- let end_time = Instant :: now ( ) ;
265
-
266
- tracing:: info!(
267
- "compress: dead_branch_remover took {:?} (pass = {})" ,
268
- end_time - start_time,
269
- self . pass
270
- ) ;
271
- }
272
-
273
- #[ cfg( feature = "debug" ) ]
274
- {
275
- let simplified = dump ( & * n, false ) ;
276
-
277
- if start != simplified {
278
- debug ! (
279
- "===== Removed dead branches =====\n {}\n ==== ===== ===== ===== ======\n {}" ,
280
- start, simplified
281
- ) ;
282
- }
283
- }
284
-
285
- self . changed |= v. changed ( ) ;
286
- }
287
251
}
288
252
}
289
253
0 commit comments