Class IROptimisation
java.lang.Object
org.ek9lang.compiler.CompilerPhase
org.ek9lang.compiler.phase9.IROptimisation
- All Implemented Interfaces:
BiFunction<Workspace, CompilerFlags, CompilationPhaseResult>
SINGLE THREADED.
At this point IR is complete and viable. This phase can now optimise the IR prior to any
code generation.
The optimization level can be accessed via compilerFlags.getOptimizationLevel() which returns:
- OptimizationLevel.O0 - No optimization (fast compile, maximum debuggability)
- OptimizationLevel.O2 - Minimal optimization (balanced - default)
- OptimizationLevel.O3 - Full optimization (maximum performance)
-
Field Summary
Fields inherited from class CompilerPhase
compilableProgramAccess, listener, reporter -
Constructor Summary
ConstructorsConstructorDescriptionIROptimisation(SharedThreadContext<CompilableProgram> compilableProgramAccess, Consumer<CompilationEvent> listener, CompilerReporter reporter) -
Method Summary
Modifier and TypeMethodDescriptionbooleandoApply(Workspace workspace, CompilerFlags compilerFlags) Do the compilation phase.Methods inherited from class CompilerPhase
apply, getParsedModuleForSourceMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThen
-
Constructor Details
-
Method Details
-
doApply
Description copied from class:CompilerPhaseDo the compilation phase.- Specified by:
doApplyin classCompilerPhase
-