Annotation Interface GenerateCached
Allows to enable or disable the generation of the cached version of a Truffle DSL node. By
default any node generates a cached version of a node if it contains
specialization methods. The cached version of a node is accessed through a generated class that
is named with the suffix Gen of the source node. For example if the node containing
specializations is named TestNode the generated node will be called
TestNodeGen. Any node where generated cached is enabled will contain a
create method.
This annotation is useful if only an uncached or inlinable version of the node should be generated. It also allows to disable code generation for
abstract nodes with specializations that should not generate code.
- Since:
- 23.0
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanbooleanbooleanIftrueenables the generation of a cached version of thisspecializingnode.
-
Element Details
-
value
boolean valueIftrueenables the generation of a cached version of thisspecializingnode. It is enabled by default.- Since:
- 23.0
- Default:
true
-
inherit
boolean inheritIftrueenables inheritance ofvalue()andalwaysInlineCached()to subclasses. It isfalseby default.- Since:
- 23.0
- Default:
false
-
alwaysInlineCached
boolean alwaysInlineCachedConfigures whether acachedinlinablenode is inlined by default. By default a warning is emitted if the inline flag is not enabled explicitly. This is not necessary for nodes annotated withGenerateInlinethey must always inline their cached values, as they are otherwise themselves not inlinable.- Since:
- 23.0
- Default:
false
-