[ADT][Support] Fix C4146 error from MSVC
authorVladislav Vinogradov <vlad.vinogradov47@gmail.com>
Fri, 15 Jan 2021 22:32:38 +0000 (14:32 -0800)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 15 Jan 2021 22:34:14 +0000 (14:34 -0800)
commit76f5c5a7b059929f0e0352ad4ff5ec1b78511868
tree6063da269a540c28c095a44b4bcecb679d89d325
parentaa8a2d8a3da3704f82ba4ea3a6e7b463737597e1
[ADT][Support] Fix C4146 error from MSVC

Unary minus operator applied to unsigned type, result still unsigned.

Use `~0U` instead of `-1U` and `1 + ~VAL` instead of `-VAL`.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D94417
llvm/include/llvm/ADT/StringExtras.h
llvm/include/llvm/Support/MathExtras.h