Skip to content

Commit 7c987bb

Browse files
[X86] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
1 parent 3cbe0bc commit 7c987bb

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,30 +59,27 @@ namespace {
5959
enum {
6060
RegBase,
6161
FrameIndexBase
62-
} BaseType;
62+
} BaseType = RegBase;
6363

6464
// This is really a union, discriminated by BaseType!
6565
SDValue Base_Reg;
66-
int Base_FrameIndex;
66+
int Base_FrameIndex = 0;
6767

68-
unsigned Scale;
68+
unsigned Scale = 1;
6969
SDValue IndexReg;
70-
int32_t Disp;
70+
int32_t Disp = 0;
7171
SDValue Segment;
72-
const GlobalValue *GV;
73-
const Constant *CP;
74-
const BlockAddress *BlockAddr;
75-
const char *ES;
76-
MCSymbol *MCSym;
77-
int JT;
72+
const GlobalValue *GV = nullptr;
73+
const Constant *CP = nullptr;
74+
const BlockAddress *BlockAddr = nullptr;
75+
const char *ES = nullptr;
76+
MCSymbol *MCSym = nullptr;
77+
int JT = -1;
7878
Align Alignment; // CP alignment.
79-
unsigned char SymbolFlags; // X86II::MO_*
79+
unsigned char SymbolFlags = X86II::MO_NO_FLAG; // X86II::MO_*
8080
bool NegateIndex = false;
8181

82-
X86ISelAddressMode()
83-
: BaseType(RegBase), Base_FrameIndex(0), Scale(1), Disp(0), GV(nullptr),
84-
CP(nullptr), BlockAddr(nullptr), ES(nullptr), MCSym(nullptr), JT(-1),
85-
SymbolFlags(X86II::MO_NO_FLAG) {}
82+
X86ISelAddressMode() = default;
8683

8784
bool hasSymbolicDisplacement() const {
8885
return GV != nullptr || CP != nullptr || ES != nullptr ||

0 commit comments

Comments
 (0)