From 47b39c51572f9515ea5df2500aa9be5e7512b55e Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 18 Jun 2022 12:11:58 -0700 Subject: [PATCH] [X86] Use default member initialization (NFC) Identified with modernize-use-default-member-init. --- llvm/lib/Target/X86/X86PadShortFunction.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Target/X86/X86PadShortFunction.cpp b/llvm/lib/Target/X86/X86PadShortFunction.cpp index e92b1b002bb0..bb59cee8badb 100644 --- a/llvm/lib/Target/X86/X86PadShortFunction.cpp +++ b/llvm/lib/Target/X86/X86PadShortFunction.cpp @@ -37,21 +37,20 @@ STATISTIC(NumBBsPadded, "Number of basic blocks padded"); namespace { struct VisitedBBInfo { // HasReturn - Whether the BB contains a return instruction - bool HasReturn; + bool HasReturn = false; // Cycles - Number of cycles until return if HasReturn is true, otherwise // number of cycles until end of the BB - unsigned int Cycles; + unsigned int Cycles = 0; - VisitedBBInfo() : HasReturn(false), Cycles(0) {} + VisitedBBInfo() = default; VisitedBBInfo(bool HasReturn, unsigned int Cycles) : HasReturn(HasReturn), Cycles(Cycles) {} }; struct PadShortFunc : public MachineFunctionPass { static char ID; - PadShortFunc() : MachineFunctionPass(ID) - , Threshold(4) {} + PadShortFunc() : MachineFunctionPass(ID) {} bool runOnMachineFunction(MachineFunction &MF) override; @@ -82,7 +81,7 @@ namespace { MachineBasicBlock::iterator &MBBI, unsigned int NOOPsToAdd); - const unsigned int Threshold; + const unsigned int Threshold = 4; // ReturnBBs - Maps basic blocks that return to the minimum number of // cycles until the return, starting from the entry block.