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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 29 05:58:56 PDT 2016


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM, thank you!


================
Comment at: include/llvm/Support/MathExtras.h:672
@@ -669,2 +671,3 @@
 inline uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew = 0) {
+  assert(Align != 0u);
   Skew %= Align;
----------------
hubert.reinterpretcast wrote:
> aaron.ballman wrote:
> > Usually preferred to put in && "rationale goes here" for asserts (here and elsewhere).
> > 
> > Were these changes expected, as they don't seem to relate to constexpr?
> Sure, I can add the "friendly text".
> 
> Also, these changes are expected. The behaviour of these functions when Align is 0 is the reason why I did not modify them so that they may be marked constexpr (according to the language).
Ah, okay, that makes sense to me. Thank you! Go ahead and add the friendly text when you commit (no need to review further).


https://reviews.llvm.org/D22824





More information about the cfe-commits mailing list