Module org.kink_lang.kink
Class SsaChecker
java.lang.Object
org.kink_lang.kink.internal.program.itreeoptimize.ssafy.SsaChecker
- All Implemented Interfaces:
DeepTransformer.Callback
Determines whether a fun can be converted to SSA.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Unchecked exception for an itree which cannot be converted to SSA. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canConvertToSsa
(Itree body) Determines whether a fun can be converted to SSA.Transforms dereference of a local var.Transforms the itree.Transforms storing to a local var.
-
Constructor Details
-
SsaChecker
public SsaChecker()
-
-
Method Details
-
canConvertToSsa
Determines whether a fun can be converted to SSA.- Parameters:
body
- the fun body to test.- Returns:
- whether the fun can be converted to SSA.
-
derefLvar
Description copied from interface:DeepTransformer.Callback
Transforms dereference of a local var.Dereference of
NoTraitNewValItree
,TraitNewValItree
,IfItree
,BranchItree
, andBranchWithElseItree
must not be transformed.- Specified by:
derefLvar
in interfaceDeepTransformer.Callback
- Parameters:
lvar
- the local var.- Returns:
- the result of transformation.
-
storeLvar
Description copied from interface:DeepTransformer.Callback
Transforms storing to a local var.- Specified by:
storeLvar
in interfaceDeepTransformer.Callback
- Parameters:
lvar
- the original local var to be transformed.- Returns:
- the result of transformation.
-
itree
Description copied from interface:DeepTransformer.Callback
Transforms the itree.If
itree
isFastFunItree
, the result must also beFastFunItree
.- Specified by:
itree
in interfaceDeepTransformer.Callback
- Parameters:
itree
- the itree to be transformed.- Returns:
- the result of transformation.
-