forked from OSchip/llvm-project
Fix for broken build on clang-hexagon-elf for ambiguous call to
std::abs. llvm-svn: 339044
This commit is contained in:
parent
10fd92dd94
commit
7c4f4914e3
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue