Skip to content

Commit 750c219

Browse files
author
git apple-llvm automerger
committed
Merge commit 'a76bf4da5318' from llvm.org/main into next
2 parents 13f6e26 + a76bf4d commit 750c219

19 files changed

+84
-50
lines changed

llvm/include/llvm/ADT/IntervalMap.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2132,9 +2132,10 @@ class IntervalMapOverlaps {
21322132
posB.advanceTo(posA.start());
21332133
if (!posB.valid() || !Traits::stopLess(posA.stop(), posB.start()))
21342134
return;
2135-
} else
2135+
} else {
21362136
// Already overlapping.
21372137
return;
2138+
}
21382139

21392140
while (true) {
21402141
// Make a.end > b.start.

llvm/include/llvm/ADT/STLExtras.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,8 +1804,9 @@ T *find_singleton(R &&Range, Predicate P, bool AllowRepeats = false) {
18041804
if (RC) {
18051805
if (!AllowRepeats || PRC != RC)
18061806
return nullptr;
1807-
} else
1807+
} else {
18081808
RC = PRC;
1809+
}
18091810
}
18101811
}
18111812
return RC;
@@ -1835,8 +1836,9 @@ std::pair<T *, bool> find_singleton_nested(R &&Range, Predicate P,
18351836
if (RC) {
18361837
if (!AllowRepeats || PRC.first != RC)
18371838
return {nullptr, true};
1838-
} else
1839+
} else {
18391840
RC = PRC.first;
1841+
}
18401842
}
18411843
}
18421844
return {RC, false};

llvm/include/llvm/ADT/SmallBitVector.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,9 @@ class SmallBitVector {
393393
uintptr_t IMask = ((uintptr_t)1) << I;
394394
uintptr_t Mask = EMask - IMask;
395395
setSmallBits(getSmallBits() | Mask);
396-
} else
396+
} else {
397397
getPointer()->set(I, E);
398+
}
398399
return *this;
399400
}
400401

@@ -424,8 +425,9 @@ class SmallBitVector {
424425
uintptr_t IMask = ((uintptr_t)1) << I;
425426
uintptr_t Mask = EMask - IMask;
426427
setSmallBits(getSmallBits() & ~Mask);
427-
} else
428+
} else {
428429
getPointer()->reset(I, E);
430+
}
429431
return *this;
430432
}
431433

llvm/include/llvm/ADT/Twine.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,9 @@ namespace llvm {
275275
if (Str[0] != '\0') {
276276
LHS.cString = Str;
277277
LHSKind = CStringKind;
278-
} else
278+
} else {
279279
LHSKind = EmptyKind;
280+
}
280281

281282
assert(isValid() && "Invalid twine!");
282283
}

llvm/include/llvm/Support/Error.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,9 @@ class LLVM_ABI ErrorList final : public ErrorInfo<ErrorList> {
418418
auto &E2List = static_cast<ErrorList &>(*E2Payload);
419419
for (auto &Payload : E2List.Payloads)
420420
E1List.Payloads.push_back(std::move(Payload));
421-
} else
421+
} else {
422422
E1List.Payloads.push_back(E2.takePayload());
423+
}
423424

424425
return E1;
425426
}
@@ -714,10 +715,11 @@ template <class T> class [[nodiscard]] Expected {
714715
if (HasError) {
715716
dbgs() << "Unchecked Expected<T> contained error:\n";
716717
(*getErrorStorage())->log(dbgs());
717-
} else
718+
} else {
718719
dbgs() << "Expected<T> value was in success state. (Note: Expected<T> "
719720
"values in success mode must still be checked prior to being "
720721
"destroyed).\n";
722+
}
721723
abort();
722724
}
723725
#endif

llvm/include/llvm/Support/GenericLoopInfoImpl.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,9 @@ void LoopBase<BlockT, LoopT>::print(raw_ostream &OS, bool Verbose,
425425
if (i)
426426
OS << ",";
427427
BB->printAsOperand(OS, false);
428-
} else
429-
OS << "\n";
428+
} else {
429+
OS << '\n';
430+
}
430431

431432
if (BB == H)
432433
OS << "<header>";

llvm/include/llvm/Support/GraphWriter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,9 @@ class GraphWriter {
200200
O << "<<table border=\"0\" cellborder=\"1\" cellspacing=\"0\""
201201
<< " cellpadding=\"0\"><tr><td align=\"text\" colspan=\"" << ColSpan
202202
<< "\">";
203-
} else
203+
} else {
204204
O << "\"{";
205+
}
205206

206207
if (!DTraits.renderGraphFromBottomUp()) {
207208
if (RenderUsingHTML)

llvm/include/llvm/Support/YAMLParser.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
// yaml::Node *n = di->getRoot();
2828
// if (n) {
2929
// // Do something with n...
30-
// } else
30+
// } else {
3131
// break;
32+
// }
3233
// }
3334
//
3435
//===----------------------------------------------------------------------===//

llvm/lib/Support/APFixedPoint.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,9 @@ APFixedPoint APFixedPoint::mul(const APFixedPoint &Other,
289289
Result = Min;
290290
else if (Result > Max)
291291
Result = Max;
292-
} else
292+
} else {
293293
Overflowed = Result < Min || Result > Max;
294+
}
294295

295296
if (Overflow)
296297
*Overflow = Overflowed;
@@ -335,8 +336,9 @@ APFixedPoint APFixedPoint::div(const APFixedPoint &Other,
335336
// towards negative infinity by subtracting epsilon from the result.
336337
if (ThisVal.isNegative() != OtherVal.isNegative() && !Rem.isZero())
337338
Result = Result - 1;
338-
} else
339+
} else {
339340
Result = ThisVal.udiv(OtherVal);
341+
}
340342
Result.setIsSigned(CommonFXSema.isSigned());
341343

342344
// If our result lies outside of the representative range of the common
@@ -350,8 +352,9 @@ APFixedPoint APFixedPoint::div(const APFixedPoint &Other,
350352
Result = Min;
351353
else if (Result > Max)
352354
Result = Max;
353-
} else
355+
} else {
354356
Overflowed = Result < Min || Result > Max;
357+
}
355358

356359
if (Overflow)
357360
*Overflow = Overflowed;
@@ -385,8 +388,9 @@ APFixedPoint APFixedPoint::shl(unsigned Amt, bool *Overflow) const {
385388
Result = Min;
386389
else if (Result > Max)
387390
Result = Max;
388-
} else
391+
} else {
389392
Overflowed = Result < Min || Result > Max;
393+
}
390394

391395
if (Overflow)
392396
*Overflow = Overflowed;
@@ -612,8 +616,9 @@ APFixedPoint::getFromFloatValue(const APFloat &Value,
612616
Res = getMax(DstFXSema).getValue();
613617
else if (Val < FloatMin)
614618
Res = getMin(DstFXSema).getValue();
615-
} else
619+
} else {
616620
Overflowed = Val > FloatMax || Val < FloatMin;
621+
}
617622

618623
if (Overflow)
619624
*Overflow = Overflowed;

llvm/lib/Support/APFloat.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,9 @@ writeSignedDecimal (char *dst, int value)
893893
if (value < 0) {
894894
*dst++ = '-';
895895
dst = writeUnsignedDecimal(dst, -(unsigned) value);
896-
} else
896+
} else {
897897
dst = writeUnsignedDecimal(dst, value);
898+
}
898899

899900
return dst;
900901
}
@@ -2814,8 +2815,8 @@ APFloat::opStatus IEEEFloat::convertToSignExtendedInteger(
28142815
if (lost_fraction == lfExactlyZero) {
28152816
*isExact = true;
28162817
return opOK;
2817-
} else
2818-
return opInexact;
2818+
}
2819+
return opInexact;
28192820
}
28202821

28212822
/* Same as convertToSignExtendedInteger, except we provide
@@ -3302,8 +3303,9 @@ bool IEEEFloat::convertFromStringSpecials(StringRef str) {
33023303
if (str.size() > 1 && tolower(str[1]) == 'x') {
33033304
str = str.drop_front(2);
33043305
Radix = 16;
3305-
} else
3306+
} else {
33063307
Radix = 8;
3308+
}
33073309
}
33083310

33093311
// Parse the payload and make the NaN.
@@ -4529,8 +4531,9 @@ void IEEEFloat::toString(SmallVectorImpl<char> &Str, unsigned FormatPrecision,
45294531
Str.append(FormatPrecision - 1, '0');
45304532
append(Str, "e+00");
45314533
}
4532-
} else
4534+
} else {
45334535
Str.push_back('0');
4536+
}
45344537
return;
45354538

45364539
case fcNormal:

llvm/lib/Support/APInt.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,15 +878,14 @@ APInt llvm::APIntOps::RoundDoubleToAPInt(double Double, unsigned width) {
878878
/// | 1[63] 11[62-52] 52[51-00] 1023 |
879879
/// --------------------------------------
880880
double APInt::roundToDouble(bool isSigned) const {
881-
882881
// Handle the simple case where the value is contained in one uint64_t.
883882
// It is wrong to optimize getWord(0) to VAL; there might be more than one word.
884883
if (isSingleWord() || getActiveBits() <= APINT_BITS_PER_WORD) {
885884
if (isSigned) {
886885
int64_t sext = SignExtend64(getWord(0), BitWidth);
887886
return double(sext);
888-
} else
889-
return double(getWord(0));
887+
}
888+
return double(getWord(0));
890889
}
891890

892891
// Determine if the value is negative.
@@ -2578,8 +2577,9 @@ int APInt::tcMultiplyPart(WordType *dst, const WordType *src,
25782577
if (low + dst[i] < low)
25792578
high++;
25802579
dst[i] += low;
2581-
} else
2580+
} else {
25822581
dst[i] = low;
2582+
}
25832583

25842584
carry = high;
25852585
}

llvm/lib/Support/CommandLine.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2692,8 +2692,9 @@ void HelpPrinterWrapper::operator=(bool Value) {
26922692
CommonOptions->HLOp.setHiddenFlag(NotHidden);
26932693

26942694
CategorizedPrinter = true; // Invoke categorized printer
2695-
} else
2695+
} else {
26962696
UncategorizedPrinter = true; // Invoke uncategorized printer
2697+
}
26972698
}
26982699

26992700
// Print the value of each option.

llvm/lib/Support/Mustache.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,9 @@ const json::Value *ASTNode::findContext() {
660660
CurrentContext = CurrentValue->getAsObject();
661661
if (!CurrentContext)
662662
return nullptr;
663-
} else
663+
} else {
664664
Context = CurrentValue;
665+
}
665666
}
666667
return Context;
667668
}

llvm/lib/Support/PrettyStackTrace.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ static void CrashHandler(void *) {
185185
if (!crashHandlerString.empty()) {
186186
setCrashLogMessage(crashHandlerString.c_str());
187187
errs() << crashHandlerString.str();
188-
} else
188+
} else {
189189
setCrashLogMessage("No crash information.");
190+
}
190191
#endif
191192
}
192193

llvm/lib/Support/ScaledNumber.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,9 @@ std::string ScaledNumberBase::toString(uint64_t D, int16_t E, int Width,
240240
if (Above0) {
241241
appendNumber(Str, Above0);
242242
DigitsOut = Str.size();
243-
} else
243+
} else {
244244
appendDigit(Str, 0);
245+
}
245246
std::reverse(Str.begin(), Str.end());
246247

247248
// Return early if there's nothing after the decimal.
@@ -262,8 +263,9 @@ std::string ScaledNumberBase::toString(uint64_t D, int16_t E, int Width,
262263
if (ExtraShift) {
263264
--ExtraShift;
264265
Error *= 5;
265-
} else
266+
} else {
266267
Error *= 10;
268+
}
267269

268270
Below0 *= 10;
269271
Extra *= 10;

llvm/lib/Support/Unix/Path.inc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,9 @@ std::error_code current_path(SmallVectorImpl<char> &result) {
389389
}
390390
// Otherwise there just wasn't enough space.
391391
result.resize_for_overwrite(result.capacity() * 2);
392-
} else
392+
} else {
393393
break;
394+
}
394395
}
395396

396397
result.truncate(strlen(result.data()));
@@ -944,8 +945,9 @@ std::error_code detail::directory_iterator_increment(detail::DirIterState &It) {
944945
(Name.size() == 2 && Name[0] == '.' && Name[1] == '.'))
945946
return directory_iterator_increment(It);
946947
It.CurrentEntry.replace_filename(Name, direntType(CurDir));
947-
} else
948+
} else {
948949
return directory_iterator_destruct(It);
950+
}
949951

950952
return std::error_code();
951953
}

llvm/lib/Support/Windows/Path.inc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ std::error_code widenPath(const Twine &Path8, SmallVectorImpl<wchar_t> &Path16,
118118
if (RootName[1] != ':') { // Check if UNC.
119119
FullPath.append("UNC\\");
120120
FullPath.append(Path8Str.begin() + 2, Path8Str.end());
121-
} else
121+
} else {
122122
FullPath.append(Path8Str);
123+
}
123124

124125
return UTF8ToUTF16(FullPath, Path16);
125126
}
@@ -1069,8 +1070,9 @@ std::error_code detail::directory_iterator_construct(detail::DirIterState &IT,
10691070
if (LastError == ERROR_NO_MORE_FILES)
10701071
return detail::directory_iterator_destruct(IT);
10711072
return mapWindowsError(LastError);
1072-
} else
1073+
} else {
10731074
FilenameLen = ::wcslen(FirstFind.cFileName);
1075+
}
10741076

10751077
// Construct the current directory entry.
10761078
SmallString<128> DirectoryEntryNameUTF8;

0 commit comments

Comments
 (0)