From 595394321d51c49e317a8a8da944e203f9b8633c Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 17 Apr 2021 12:00:38 +0100 Subject: [PATCH] [Support] AbsoluteDifference - add brackets to appease static analyzer warning. NFCI. --- llvm/include/llvm/Support/MathExtras.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h index 10d4260..753b199 100644 --- a/llvm/include/llvm/Support/MathExtras.h +++ b/llvm/include/llvm/Support/MathExtras.h @@ -792,7 +792,7 @@ inline int64_t SignExtend64(uint64_t X, unsigned B) { /// value of the result. template std::enable_if_t::value, T> AbsoluteDifference(T X, T Y) { - return X > Y ? X - Y : Y - X; + return X > Y ? (X - Y) : (Y - X); } /// Add two unsigned integers, X and Y, of type T. Clamp the result to the -- 2.7.4