[llvm] af2a93f - Revert "[Support] Don't include <algorithm> in MathExtras.h"
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 21 17:19:09 PDT 2021
Please include some details about why a patch is being reverted in the
commit message. (& as I think Nico alluded to in the other review thread -
if the issue is something as simple as a missing #include, usually we'd
prefer to fix-forward in that situation - we all pitch in and fix whatever
we come across when it's fairly clear what the fix should be)
On Fri, Apr 16, 2021 at 10:22 AM Stella Stamenova via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
>
> Author: Stella Stamenova
> Date: 2021-04-16T10:22:32-07:00
> New Revision: af2a93fd6e9f9e037d2e2d67b879fe85d7e1cbed
>
> URL:
> https://github.com/llvm/llvm-project/commit/af2a93fd6e9f9e037d2e2d67b879fe85d7e1cbed
> DIFF:
> https://github.com/llvm/llvm-project/commit/af2a93fd6e9f9e037d2e2d67b879fe85d7e1cbed.diff
>
> LOG: Revert "[Support] Don't include <algorithm> in MathExtras.h"
>
> This reverts commit 6580d8a2b14d50b7e067dc86df6e5dd65703d147.
>
> Added:
>
>
> Modified:
> llvm/include/llvm/Support/MathExtras.h
>
> Removed:
>
>
>
>
> ################################################################################
> diff --git a/llvm/include/llvm/Support/MathExtras.h
> b/llvm/include/llvm/Support/MathExtras.h
> index 10d4260a7eb1..640b3a11ce6c 100644
> --- a/llvm/include/llvm/Support/MathExtras.h
> +++ b/llvm/include/llvm/Support/MathExtras.h
> @@ -14,6 +14,7 @@
> #define LLVM_SUPPORT_MATHEXTRAS_H
>
> #include "llvm/Support/Compiler.h"
> +#include <algorithm>
> #include <cassert>
> #include <climits>
> #include <cmath>
> @@ -792,7 +793,7 @@ inline int64_t SignExtend64(uint64_t X, unsigned B) {
> /// value of the result.
> template <typename T>
> std::enable_if_t<std::is_unsigned<T>::value, T> AbsoluteDifference(T X, T
> Y) {
> - return X > Y ? X - Y : Y - X;
> + return std::max(X, Y) - std::min(X, Y);
> }
>
> /// Add two unsigned integers, X and Y, of type T. Clamp the result to
> the
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210421/8c534476/attachment.html>
More information about the llvm-commits
mailing list