[Support] AbsoluteDifference - add brackets to appease static analyzer warning. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 17 Apr 2021 11:00:38 +0000 (12:00 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 17 Apr 2021 12:47:02 +0000 (13:47 +0100)
llvm/include/llvm/Support/MathExtras.h

index 10d4260..753b199 100644 (file)
@@ -792,7 +792,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 X > Y ? (X - Y) : (Y - X);
 }
 
 /// Add two unsigned integers, X and Y, of type T.  Clamp the result to the