public void stage2Passes ( ) { checkState ( moduleGraph != null , "No inputs. Did you call init() or initModules()?" ) ; checkState ( ! hasErrors ( ) ) ; checkState ( ! options . getInstrumentForCoverageOnly ( ) ) ; JSModule weakModule = moduleGraph . getModuleByName ( JSModule . WEAK_MODULE_NAME ) ; if ( weakModule != null ) { for ( CompilerInput i : moduleGraph . getAllInputs ( ) ) { if ( i . getSourceFile ( ) . isWeak ( ) ) { checkState ( i . getModule ( ) == weakModule , "Expected all weak files to be in the weak module." ) ; } } } runInCompilerThread ( ( ) -> { if ( options . shouldOptimize ( ) ) { performOptimizations ( ) ; } return null ; } ) ; }
Perform compiler passes for stage 2 of compilation .