Skip to content

Commit 47b39c5

Browse files
[X86] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
1 parent 1590d39 commit 47b39c5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/lib/Target/X86/X86PadShortFunction.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,20 @@ STATISTIC(NumBBsPadded, "Number of basic blocks padded");
3737
namespace {
3838
struct VisitedBBInfo {
3939
// HasReturn - Whether the BB contains a return instruction
40-
bool HasReturn;
40+
bool HasReturn = false;
4141

4242
// Cycles - Number of cycles until return if HasReturn is true, otherwise
4343
// number of cycles until end of the BB
44-
unsigned int Cycles;
44+
unsigned int Cycles = 0;
4545

46-
VisitedBBInfo() : HasReturn(false), Cycles(0) {}
46+
VisitedBBInfo() = default;
4747
VisitedBBInfo(bool HasReturn, unsigned int Cycles)
4848
: HasReturn(HasReturn), Cycles(Cycles) {}
4949
};
5050

5151
struct PadShortFunc : public MachineFunctionPass {
5252
static char ID;
53-
PadShortFunc() : MachineFunctionPass(ID)
54-
, Threshold(4) {}
53+
PadShortFunc() : MachineFunctionPass(ID) {}
5554

5655
bool runOnMachineFunction(MachineFunction &MF) override;
5756

@@ -82,7 +81,7 @@ namespace {
8281
MachineBasicBlock::iterator &MBBI,
8382
unsigned int NOOPsToAdd);
8483

85-
const unsigned int Threshold;
84+
const unsigned int Threshold = 4;
8685

8786
// ReturnBBs - Maps basic blocks that return to the minimum number of
8887
// cycles until the return, starting from the entry block.

0 commit comments

Comments
 (0)