[clang][Interp] Fix compound assign operator types
authorTimm Bäder <tbaeder@redhat.com>
Sun, 22 Jan 2023 20:09:35 +0000 (21:09 +0100)
committerTimm Bäder <tbaeder@redhat.com>
Wed, 25 Jan 2023 09:12:26 +0000 (10:12 +0100)
commitde3a3cb987f11075a62680c001d3cadd0a1d1397
tree02aba454eaa9ede8df4b545c50c7aac7742a9d9b
parent5b39387fb8aa6f8b755b633736f3548e348d0ee6
[clang][Interp] Fix compound assign operator types

Just like we do (or will do) for floating types, we need to take into
acocunt that the LHSComputationType, ResultType and type of the
expression (what we ultimately store) might be different.

Do this by emitting cast ops before and after doing the computation.

This fixes the test failures introduced by
490e8214fca48824beda8b508d6d6bbbf3d8d9a7 on big endian machines.

Differential Revision: https://reviews.llvm.org/D142328
clang/lib/AST/Interp/ByteCodeExprGen.cpp