Add methods for combine InvocationKind's

There is two methods added -- `or` and `and`

`or` is used by CFA for combining two kinds that came from different
edges of control flow graph

`and` is analog of `+` operator for invocation kinds
This commit is contained in:
Dmitriy Novozhilov
2020-06-17 10:21:34 +03:00
parent 4078b4b6f9
commit 25621d699b
3 changed files with 29 additions and 8 deletions
@@ -192,7 +192,7 @@ class ContractSerializer {
InvocationKind.AT_MOST_ONCE -> ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE
InvocationKind.EXACTLY_ONCE -> ProtoBuf.Effect.InvocationKind.EXACTLY_ONCE
InvocationKind.AT_LEAST_ONCE -> ProtoBuf.Effect.InvocationKind.AT_LEAST_ONCE
InvocationKind.UNKNOWN -> null
else -> null
}
private fun constantValueProtobufEnum(constantReference: ConstantReference): ProtoBuf.Expression.ConstantValue? =