C++: Simplify 'converts'.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-03-30 11:16:54 +01:00
parent 4b2758f1b5
commit 4602a8ae4a

View File

@@ -22,17 +22,8 @@ module SemanticExprConfig {
/** Holds if this instruction converts a value of type `tFrom` to a value of type `tTo`. */
predicate converts(SemType tFrom, SemType tTo) {
exists(IR::ConvertInstruction convert |
this = convert and
tFrom = getSemanticType(convert.getUnary().getResultIRType()) and
tTo = getSemanticType(convert.getResultIRType())
)
or
exists(IR::CopyValueInstruction copy |
this = copy and
tFrom = getSemanticType(copy.getUnary().getResultIRType()) and
tTo = getSemanticType(copy.getResultIRType())
)
tFrom = getSemanticType(this.getUnary().getResultIRType()) and
tTo = getSemanticType(this.getResultIRType())
}
}