aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cgcc
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-08-23 16:43:08 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-01 00:40:57 +0100
commit226b62bc2ee4779447ce788d83aa0b409e384ec8 (patch)
treeace913c378dd4085c34112c9e8602a7b39f75c27 /cgcc
parent594c7389969f79919f1170693c970fb25b8bfe4d (diff)
downloadsparse-dev-226b62bc2ee4779447ce788d83aa0b409e384ec8.tar.gz
eval_insn: give an explicit type to compare's operands
The return type of IR instructions is stored in the field ::type of struct instruction and this struct has no space to hold the type of the operand(s). This is not a problem for most instructions because there is an easy way to get the operands' type. For example, for binops both types must be the same so they are used interchangeably. However, for compare instructions both types can be different and there is no easy way to get the type of the operands. Currently, this is ignored and creates some errors. It also blocks simplifications that need this type information. But compares instructions need only 2 operands, there is thus one 'slot' left. So, use this slot for the operands' type. This solves the current errors, allows new simplifications and has very little impact on existing code. Of course, this type information needs now to be tracked and adjusted whenever the operands change or an instruction is changed into a compare. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'cgcc')
0 files changed, 0 insertions, 0 deletions