Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions llvm/include/llvm/ADT/PagedVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ template <typename T, size_t PageSize = 1024 / sizeof(T)> class PagedVector {
while (ElementIdx < PV->Size &&
!PV->PageToDataPtrs[ElementIdx / PageSize])
ElementIdx += PageSize;
if (ElementIdx > PV->Size)
ElementIdx = PV->Size;
ElementIdx = std::min(ElementIdx, PV->Size);
}

return *this;
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Support/GraphWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ template <typename GraphType, typename Derived> class GraphWriterBase {
const void *DestNodeID, int DestNodePort,
const std::string &Attrs) {
if (SrcNodePort > 64) return; // Eminating from truncated part?
if (DestNodePort > 64) DestNodePort = 64; // Targeting the truncated part?
DestNodePort = std::min(DestNodePort, 64); // Targeting the truncated part?

O << "\tNode" << SrcNodeID;
if (SrcNodePort >= 0)
Expand Down
9 changes: 3 additions & 6 deletions llvm/lib/Support/APFloat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2600,8 +2600,7 @@ APFloat::opStatus IEEEFloat::convert(const fltSemantics &toSemantics,
int exponentChange = omsb - fromSemantics.precision;
if (exponent + exponentChange < toSemantics.minExponent)
exponentChange = toSemantics.minExponent - exponent;
if (exponentChange < shift)
exponentChange = shift;
exponentChange = std::max(exponentChange, shift);
if (exponentChange < 0) {
shift -= exponentChange;
exponent += exponentChange;
Expand Down Expand Up @@ -3043,8 +3042,7 @@ IEEEFloat::roundSignificandWithExponent(const integerPart *decSigParts,
if (decSig.exponent < semantics->minExponent) {
excessPrecision += (semantics->minExponent - decSig.exponent);
truncatedBits = excessPrecision;
if (excessPrecision > calcSemantics.precision)
excessPrecision = calcSemantics.precision;
excessPrecision = std::min(excessPrecision, calcSemantics.precision);
}
/* Extra half-ulp lost in reciprocal of exponent. */
powHUerr = (powStatus == opOK && calcLostFraction == lfExactlyZero) ? 0:2;
Expand Down Expand Up @@ -3441,8 +3439,7 @@ char *IEEEFloat::convertNormalToHexString(char *dst, unsigned int hexDigits,
/* Convert as much of "part" to hexdigits as we can. */
unsigned int curDigits = integerPartWidth / 4;

if (curDigits > outputDigits)
curDigits = outputDigits;
curDigits = std::min(curDigits, outputDigits);
dst += partAsHex (dst, part, curDigits, hexDigitChars);
outputDigits -= curDigits;
}
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Support/Unix/Signals.inc
Original file line number Diff line number Diff line change
Expand Up @@ -868,8 +868,7 @@ void llvm::sys::PrintStackTrace(raw_ostream &OS, int Depth) {
nwidth = strlen(name) - 1;
}

if (nwidth > width)
width = nwidth;
width = std::max(nwidth, width);
}

for (int i = 0; i < depth; ++i) {
Expand Down