]> granicus.if.org Git - llvm/commit
[Support] Added overflow checking add, sub and mul.
authorJF Bastien <jfbastien@apple.com>
Wed, 31 Jul 2019 19:40:07 +0000 (19:40 +0000)
committerJF Bastien <jfbastien@apple.com>
Wed, 31 Jul 2019 19:40:07 +0000 (19:40 +0000)
commit44846c4c50b6f0bf196150018e3132b21ff88b37
tree4877401e3b8647a6bf183dccafd72b16a4a174a2
parent0867751d82fcfaba7c2670311f2318e3bd443470
[Support] Added overflow checking add, sub and mul.

Added AddOverflow, SubOverflow and MulOverflow to compute truncated results and return a flag indicating whether overflow occured.

 Differential Revision: https://reviews.llvm.org/D65494

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367470 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/MathExtras.h
unittests/Support/MathExtrasTest.cpp