forked from OSchip/llvm-project
Revert "[Support] Don't include <algorithm> in MathExtras.h"
This reverts commit 6580d8a2b1
.
This commit is contained in:
parent
7cc4a02fa2
commit
af2a93fd6e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue