[Support] Change SaturatingAdd()/SaturatingMultiply() to use pointer for returning...
authorNathan Slingerland <slingn@gmail.com>
Wed, 9 Dec 2015 17:11:28 +0000 (17:11 +0000)
committerNathan Slingerland <slingn@gmail.com>
Wed, 9 Dec 2015 17:11:28 +0000 (17:11 +0000)
commit09a7daad01b02482a58fb2ad6972e80871040c84
tree3c062d998ea31daed9c1da906251114324bd7f10
parentcf1e58c00294ee005b4b5269a75de4c80096ba50
[Support] Change SaturatingAdd()/SaturatingMultiply() to use pointer for returning overflow state

Summary:
Improve SaturatingAdd()/SaturatingMultiply() to use bool * to optionally return overflow result.
This should make it clearer that the value is returned at callsites and reduces the size of the implementation.

Reviewers: davidxl, silvas

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15219

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