[PATCH] D22824: MathExtras.h: add LLVM_CONSTEXPR where simple

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 26 10:57:46 PDT 2016


hubert.reinterpretcast created this revision.
hubert.reinterpretcast added reviewers: aaron.ballman, faisalv, rsmith.
hubert.reinterpretcast added a subscriber: cfe-commits.

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.

https://reviews.llvm.org/D22824

Files:
  include/llvm/Support/MathExtras.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22824.65557.patch
Type: text/x-patch
Size: 7365 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160726/c7de3a24/attachment-0001.bin>


More information about the cfe-commits mailing list