[llvm] 47b39c5 - [X86] Use default member initialization (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 18 12:12:03 PDT 2022
Author: Kazu Hirata
Date: 2022-06-18T12:11:58-07:00
New Revision: 47b39c51572f9515ea5df2500aa9be5e7512b55e
URL: https://github.com/llvm/llvm-project/commit/47b39c51572f9515ea5df2500aa9be5e7512b55e
DIFF: https://github.com/llvm/llvm-project/commit/47b39c51572f9515ea5df2500aa9be5e7512b55e.diff
LOG: [X86] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
Added:
Modified:
llvm/lib/Target/X86/X86PadShortFunction.cpp
Removed:
################################################################################
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.
More information about the llvm-commits
mailing list