Skip to content

Commit 59a958a

Browse files
Apply suggestions from code review
Co-authored-by: Ellis Hoag <[email protected]>
1 parent 1bef9b1 commit 59a958a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2896,10 +2896,11 @@ void AsmPrinter::emitJumpTableInfo() {
28962896
int NextHotJumpTableIndex = 0, NextColdJumpTableIndex = JT.size() - 1;
28972897
JumpTableIndices.resize(JT.size());
28982898
for (unsigned JTI = 0, JTSize = JT.size(); JTI < JTSize; ++JTI) {
2899-
if (JT[JTI].Hotness == MachineFunctionDataHotness::Cold)
2899+
if (JT[JTI].Hotness == MachineFunctionDataHotness::Cold) {
29002900
JumpTableIndices[NextColdJumpTableIndex--] = JTI;
2901-
else
2901+
} else {
29022902
JumpTableIndices[NextHotJumpTableIndex++] = JTI;
2903+
}
29032904
}
29042905

29052906
if (NextHotJumpTableIndex != 0) {
@@ -2945,7 +2946,7 @@ void AsmPrinter::emitJumpTables(ArrayRef<unsigned> JumpTableIndices,
29452946

29462947
const auto &JT = MJTI.getJumpTables();
29472948
for (unsigned Index = 0, e = JumpTableIndices.size(); Index != e; ++Index) {
2948-
const std::vector<MachineBasicBlock *> &JTBBs =
2949+
ArrayRef<MachineBasicBlock *> JTBBs =
29492950
JT[JumpTableIndices[Index]].MBBs;
29502951

29512952
// If this jump table was deleted, ignore it.

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,10 +669,11 @@ getELFSectionNameForGlobal(const GlobalObject *GO, SectionKind Kind,
669669
// Jump table hotness takes precedence over its enclosing function's hotness
670670
// if both are available.
671671
if (JTE) {
672-
if (JTE->Hotness == MachineFunctionDataHotness::Hot)
672+
if (JTE->Hotness == MachineFunctionDataHotness::Hot) {
673673
raw_svector_ostream(Name) << ".hot";
674-
else if (JTE->Hotness == MachineFunctionDataHotness::Cold)
674+
} else if (JTE->Hotness == MachineFunctionDataHotness::Cold) {
675675
raw_svector_ostream(Name) << ".unlikely";
676+
}
676677
} else if (std::optional<StringRef> Prefix = F->getSectionPrefix()) {
677678
raw_svector_ostream(Name) << '.' << *Prefix;
678679
HasPrefix = true;

0 commit comments

Comments
 (0)