MathExtras.h: add LLVM_CONSTEXPR where simple
authorHubert Tong <hubert.reinterpretcast@gmail.com>
Sat, 30 Jul 2016 13:38:51 +0000 (13:38 +0000)
committerHubert Tong <hubert.reinterpretcast@gmail.com>
Sat, 30 Jul 2016 13:38:51 +0000 (13:38 +0000)
commita216643cd31c808a36d0c79c7f96dabc6eb6c8b7
treeb9410be936c031109bb13da5a3041e187267ee06
parentafff73cb5aae41b42bb1dc8949fa21e9838e7a92
MathExtras.h: add LLVM_CONSTEXPR where simple

Summary:
This change adds `LLVM_CONSTEXPR` to functions selected as follows:
- the body is already valid under C++11 for a `constexpr` function,
- the evaluation of the function, given constant arguments, will not
  fail during the evaluation of a constant expression, and
- the above properties are easily verifiable at a glance.

Note: the evaluation of the function cannot fail if the instantiation
triggers a static assertion failure.

Reviewers: faisalv, rsmith, aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 277269
llvm/include/llvm/Support/MathExtras.h