Break compileInternal() up into 2 independent methods.
@@ -796,6 +796,11 @@ public class Compiler extends AbstractCompiler implements ErrorHandler, SourceFi
}
private void compileInternal() {
+ parseAndPerformChecksInternal();
+ completeCompilationInternal();
+ }
+
+ private void parseAndPerformChecksInternal() {
setProgress(0.0, null);
CompilerOptionsPreprocessor.preprocess(options);
read();
@@ -823,11 +828,15 @@ public class Compiler extends AbstractCompiler implements ErrorHandler, SourceFi
if (hasErrors()) {
return;
}
+ }
+ }
- if (!options.checksOnly && !options.shouldGenerateTypedExterns()) {
+ private void completeCompilationInternal() {
+ if (!options.skipNonTranspilationPasses
+ && !options.checksOnly
+ && !options.shouldGenerateTypedExterns()) {
optimize();
}
- }
if (options.recordFunctionInformation) {
recordFunctionInformation();
