aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-06-18 12:11:58 -0700
committerKazu Hirata <kazu@google.com>2022-06-18 12:11:58 -0700
commit47b39c51572f9515ea5df2500aa9be5e7512b55e (patch)
treef2d40ccabf2b2b9e720c809c19d1dd33462d01aa
parent1590d39f2e09d3e39776b88a27cb3dec4ffd79ad (diff)
downloadllvm-47b39c51572f9515ea5df2500aa9be5e7512b55e.zip
llvm-47b39c51572f9515ea5df2500aa9be5e7512b55e.tar.gz
llvm-47b39c51572f9515ea5df2500aa9be5e7512b55e.tar.bz2
[X86] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
-rw-r--r--llvm/lib/Target/X86/X86PadShortFunction.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86PadShortFunction.cpp b/llvm/lib/Target/X86/X86PadShortFunction.cpp
index e92b1b0..bb59cee 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.