[CodeGen] Use the common semantic for fixed-point codegen, not the result semantic.
authorBevin Hansson <bevin.hansson@ericsson.com>
Fri, 26 Jun 2020 14:32:30 +0000 (16:32 +0200)
committerBevin Hansson <bevin.hansson@ericsson.com>
Mon, 29 Jun 2020 14:22:29 +0000 (16:22 +0200)
commitfefa34faf551d10967cf2547003f2dd1b2efa887
tree129b58318251e1a256e5fc5d03e9c9a9e2a835a3
parentd0b0b252e1e09f6203ca35ff87b58a2d4eafb8aa
[CodeGen] Use the common semantic for fixed-point codegen, not the result semantic.

Summary:
Using the result semantic is wrong in some cases, such as
unsigned fixed-point + signed integer. In this case, the
result semantic is unsigned and the common semantic is
signed.

Reviewers: leonardchan

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82662
clang/lib/CodeGen/CGExprScalar.cpp
clang/test/Frontend/fixed_point_add.c
clang/test/Frontend/fixed_point_div.c
clang/test/Frontend/fixed_point_mul.c
clang/test/Frontend/fixed_point_sub.c