summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/CheckedArithmeticTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add checkMulAdd helper function to CheckedArithmeticGeorge Karpenkov2018-06-131-0/+25
| | | | | | | | | | Multiplication followed by addition (https://en.wikipedia.org/wiki/Multiply–accumulate_operation) is a sufficiently common use-case to warrant a separate helper. Differential Revision: https://reviews.llvm.org/D48138 llvm-svn: 334635
* Change checked arithmetic functions API to return OptionalGeorge Karpenkov2018-06-131-34/+22
| | | | | | | | | | Returning optional is much safer. The previous API had potential to cause use of undefined variables, if the value passed by pointer was accidentally read afterwards. Differential Revision: https://reviews.llvm.org/D48137 llvm-svn: 334634
* Utility functions for checked arithmeticGeorge Karpenkov2018-03-021-0/+71
Provide checkedAdd and checkedMul functions, providing checked arithmetic on signed integers. Differential Revision: https://reviews.llvm.org/D43704 llvm-svn: 326516
OpenPOWER on IntegriCloud