]> granicus.if.org Git - llvm/commit
Silence MSVC warnings about unsigned wrapping without UB
authorReid Kleckner <rnk@google.com>
Wed, 11 Oct 2017 01:40:38 +0000 (01:40 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 11 Oct 2017 01:40:38 +0000 (01:40 +0000)
commit061e7017039f963caff79bff51c0fb43a88bebdd
tree567e13c21f13609d1495a75c145b4f1afa26e1df
parenta6676439bfc194d6fa85e669027aaf96bce67ff8
Silence MSVC warnings about unsigned wrapping without UB

Of course, casting an unsigned value too large for 'int' is UB. So,
write out the ternary. LLVM folds it to ADD anyway.

Fixes the warning from r303693 a different way.

Thanks to Erich Keane for pointing this out!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315406 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/Attributes.cpp