summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-05-22 23:02:13 +0000
committerSanjay Patel <spatel@rotateright.com>2018-05-22 23:02:13 +0000
commit067ba096ad030d2e3559c266bd36969b0c339600 (patch)
tree19781fd130931fc3aa4b59ffd03e603ec024c999 /lib/CodeGen/CGExprConstant.cpp
parentab89fc45f05fb49868d8cadf344a0e877481b0b8 (diff)
downloadclang-067ba096ad030d2e3559c266bd36969b0c339600.tar.gz
[CodeGen] use nsw negation for builtin abs
The clang builtins have the same semantics as the stdlib functions. The stdlib functions are defined in section 7.20.6.1 of the C standard with: "If the result cannot be represented, the behavior is undefined." That lets us mark the negation with 'nsw' because "sub i32 0, INT_MIN" would be UB/poison. Differential Revision: https://reviews.llvm.org/D47202 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333038 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
0 files changed, 0 insertions, 0 deletions