private List < PassFactory > getCodeRemovingPasses ( ) { List < PassFactory > passes = new ArrayList <> ( ) ; if ( options . collapseObjectLiterals ) { passes . add ( collapseObjectLiterals ) ; } if ( options . inlineVariables || options . inlineLocalVariables ) { passes . add ( inlineVariables ) ; } else if ( options . inlineConstantVars ) { passes . add ( inlineConstants ) ; } if ( options . foldConstants ) { passes . add ( peepholeOptimizations ) ; } if ( options . removeDeadCode ) { passes . add ( removeUnreachableCode ) ; } if ( shouldRunRemoveUnusedCode ( ) ) { passes . add ( removeUnusedCode ) ; } assertAllLoopablePasses ( passes ) ; return passes ; }
Creates several passes aimed at removing code .