Skip to content

Commit 0a5a061

Browse files
committed
Revert "[NFC] Fix dangling-else warning"
This reverts commit ea33083.
1 parent 51049ec commit 0a5a061

File tree

5 files changed

+9
-16
lines changed

5 files changed

+9
-16
lines changed

llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2936,9 +2936,8 @@ TEST_F(OpenMPIRBuilderTest, CriticalDirective) {
29362936
const DataLayout &DL = M->getDataLayout();
29372937
const llvm::Align TypeAlign = DL.getABITypeAlign(CriticalNamePtrTy);
29382938
const llvm::Align PtrAlign = DL.getPointerABIAlignment(GV->getAddressSpace());
2939-
if (const llvm::MaybeAlign Alignment = GV->getAlign()) {
2939+
if (const llvm::MaybeAlign Alignment = GV->getAlign())
29402940
EXPECT_EQ(*Alignment, std::max(TypeAlign, PtrAlign));
2941-
}
29422941
}
29432942

29442943
TEST_F(OpenMPIRBuilderTest, OrderedDirectiveDependSource) {

llvm/unittests/IR/AttributesTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,9 @@ TEST(Attributes, SetIntersect) {
468468
AS0 = AttributeSet::get(C0, AB0);
469469
Res = AS0.intersectWith(C0, AS1);
470470
ASSERT_EQ(Res.has_value(), CanDrop);
471-
if (CanDrop) {
471+
if (CanDrop)
472472
ASSERT_FALSE(Res->hasAttributes());
473-
}
473+
474474
AS1 = AttributeSet::get(C1, AB0);
475475
Res = AS0.intersectWith(C0, AS1);
476476
ASSERT_TRUE(Res.has_value());

llvm/unittests/IR/PatternMatch.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -637,23 +637,20 @@ TEST_F(PatternMatchTest, CheckedInt) {
637637
CRes = nullptr;
638638
EXPECT_EQ(CheckUgt1(APVal), m_CheckedInt(CheckUgt1).match(C));
639639
EXPECT_EQ(CheckUgt1(APVal), m_CheckedInt(CRes, CheckUgt1).match(C));
640-
if (CheckUgt1(APVal)) {
640+
if (CheckUgt1(APVal))
641641
EXPECT_EQ(CRes, C);
642-
}
643642

644643
CRes = nullptr;
645644
EXPECT_EQ(CheckNonZero(APVal), m_CheckedInt(CheckNonZero).match(C));
646645
EXPECT_EQ(CheckNonZero(APVal), m_CheckedInt(CRes, CheckNonZero).match(C));
647-
if (CheckNonZero(APVal)) {
646+
if (CheckNonZero(APVal))
648647
EXPECT_EQ(CRes, C);
649-
}
650648

651649
CRes = nullptr;
652650
EXPECT_EQ(CheckPow2(APVal), m_CheckedInt(CheckPow2).match(C));
653651
EXPECT_EQ(CheckPow2(APVal), m_CheckedInt(CRes, CheckPow2).match(C));
654-
if (CheckPow2(APVal)) {
652+
if (CheckPow2(APVal))
655653
EXPECT_EQ(CRes, C);
656-
}
657654

658655
};
659656

@@ -713,9 +710,8 @@ TEST_F(PatternMatchTest, CheckedInt) {
713710
EXPECT_EQ(Expec, m_CheckedInt(CRes, CheckFn).match(C));
714711
if (Expec) {
715712
EXPECT_NE(CRes, nullptr);
716-
if (AllSame) {
713+
if (AllSame)
717714
EXPECT_EQ(CRes, C);
718-
}
719715
}
720716
};
721717
auto DoVecCheck = [&](ArrayRef<std::optional<int8_t>> Vals) {

llvm/unittests/Object/ELFObjectFileTest.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,9 +1244,8 @@ TEST(ELFObjectFileTest, ReadPGOAnalysisMap) {
12441244
}
12451245
EXPECT_EQ(PGOAnalyses, *ExpectedPGO);
12461246
for (auto &&[BB, PGO] : llvm::zip(*BBAddrMaps, PGOAnalyses)) {
1247-
if (PGO.FeatEnable.BBFreq || PGO.FeatEnable.BrProb) {
1247+
if (PGO.FeatEnable.BBFreq || PGO.FeatEnable.BrProb)
12481248
EXPECT_EQ(BB.getNumBBEntries(), PGO.BBEntries.size());
1249-
}
12501249
}
12511250
}
12521251
};

llvm/unittests/ProfileData/CoverageMappingTest.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,9 +1113,8 @@ TEST(CoverageMappingTest, TVIdxBuilder) {
11131113
EXPECT_EQ(Node.Width, IndicesRefs[I].Width);
11141114
for (int C = 0; C < 2; ++C) {
11151115
auto Index = TheBuilder.Indices[I][C];
1116-
if (Node.NextIDs[C] < 0) {
1116+
if (Node.NextIDs[C] < 0)
11171117
EXPECT_TRUE(Decisions.insert({Index, Node.Width}).second);
1118-
}
11191118
}
11201119
#endif
11211120
}

0 commit comments

Comments
 (0)