Package-level declarations

Types

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class DependsOn(val value: KClass<out Pass<*>>, val softDependency: Boolean = false)

Register a dependency for the annotated pass. This ensures that:

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class ExecuteBefore(val other: KClass<out Pass<*>>, val softDependency: Boolean = true)

Register a dependency for the annotated pass. This ensures that the annotated pass is executed before other pass. The softDependency flag decides whether to treat this as a hard dependency (resulting in the pass being registered if not present) or not.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class ExecuteFirst

Indicates whether this pass should be executed as the first pass. Note: setting this flag for more than one active pass will yield an error. Note: setting this flag will not activate the pass. You must register the pass manually.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class ExecuteLast

Indicates whether this pass should be executed as the last pass. Note: setting this flag for more than one active pass will yield an error. Note: setting this flag will not activate the pass. You must register the pass manually.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class ExecuteLate

Indicates whether this pass should be executed as late as possible (without breaking any other constraints like ExecuteLast or DependsOn, ...)

Link copied to clipboard

The goal of this class is to provide ordered passes when invoking the order function.

Link copied to clipboard
data class PassWithDependencies(val passClass: KClass<out Pass<*>>, val dependenciesRemaining: MutableSet<KClass<out Pass<*>>>)

A simple helper class to match a pass with its dependencies. dependenciesRemaining shows the currently remaining / unsatisfied dependencies. These values are updated during the ordering procedure.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class RegisterExtraPass(val value: KClass<out Pass<*>>)

Register a new default pass required by a frontend. Passes annotated this way are collected by TranslationConfiguration.Builder.registerExtraFrontendPasses and automatically registered in TranslationConfiguration.Builder.build, but only if TranslationConfiguration.Builder.defaultPasses was called.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class ReplacePass(val old: KClass<out Pass<*>>, val lang: KClass<out Language<*>>, val with: KClass<out Pass<*>>)

This annotation can be used to replace a certain Pass (identified by old) for a specific Language (identified by lang) with another Pass (identified by with).

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class RequiredFrontend(val value: KClass<out LanguageFrontend<*, *>>)

This annotation can only enable a pass for a given LanguageFrontend. The pass's accept function will not be executed when the current language does not match the required language.

Link copied to clipboard
annotation class RequiresLanguageTrait(val value: KClass<out LanguageTrait>)

This annotation can only enable a pass if its target language implements a given LanguageTrait.