Fix for broken build on clang-hexagon-elf for ambiguous call to

std::abs.

llvm-svn: 339044
This commit is contained in:
Leonard Chan 2018-08-06 19:31:00 +00:00
parent 10fd92dd94
commit 7c4f4914e3
1 changed files with 2 additions and 1 deletions

View File

@ -59,7 +59,8 @@ int APFixedPoint::compare(const APFixedPoint &Other) const {
unsigned CommonWidth = std::max(Val.getBitWidth(), OtherWidth);
// Prevent overflow in the event the widths are the same but the scales differ
CommonWidth += std::abs(static_cast<int>(getScale() - OtherScale));
CommonWidth += getScale() >= OtherScale ? getScale() - OtherScale
: OtherScale - getScale();
ThisVal = ThisVal.extOrTrunc(CommonWidth);
OtherVal = OtherVal.extOrTrunc(CommonWidth);