Skip to content

Commit eabd405

Browse files
committed
[X86] Fix uninitialized variable warnings. NFCI.
1 parent cfc385d commit eabd405

File tree

7 files changed

+26
-26
lines changed

7 files changed

+26
-26
lines changed

llvm/lib/Target/X86/X86CallFrameOptimization.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ class X86CallFrameOptimization : public MachineFunctionPass {
115115

116116
StringRef getPassName() const override { return "X86 Optimize Call Frame"; }
117117

118-
const X86InstrInfo *TII;
119-
const X86FrameLowering *TFL;
120-
const X86Subtarget *STI;
121-
MachineRegisterInfo *MRI;
122-
unsigned SlotSize;
123-
unsigned Log2SlotSize;
118+
const X86InstrInfo *TII = nullptr;
119+
const X86FrameLowering *TFL = nullptr;
120+
const X86Subtarget *STI = nullptr;
121+
MachineRegisterInfo *MRI = nullptr;
122+
unsigned SlotSize = 0;
123+
unsigned Log2SlotSize = 0;
124124
};
125125

126126
} // end anonymous namespace

llvm/lib/Target/X86/X86CmovConversion.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ class X86CmovConverterPass : public MachineFunctionPass {
111111
static char ID;
112112

113113
private:
114-
MachineRegisterInfo *MRI;
115-
const TargetInstrInfo *TII;
116-
const TargetRegisterInfo *TRI;
114+
MachineRegisterInfo *MRI = nullptr;
115+
const TargetInstrInfo *TII = nullptr;
116+
const TargetRegisterInfo *TRI = nullptr;
117117
TargetSchedModel TSchedModel;
118118

119119
/// List of consecutive CMOV instructions.

llvm/lib/Target/X86/X86DomainReassignment.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,9 @@ class Closure {
373373
};
374374

375375
class X86DomainReassignment : public MachineFunctionPass {
376-
const X86Subtarget *STI;
377-
MachineRegisterInfo *MRI;
378-
const X86InstrInfo *TII;
376+
const X86Subtarget *STI = nullptr;
377+
MachineRegisterInfo *MRI = nullptr;
378+
const X86InstrInfo *TII = nullptr;
379379

380380
/// All edges that are included in some closure
381381
DenseSet<unsigned> EnclosedEdges;

llvm/lib/Target/X86/X86EvexToVex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class EvexToVexInstPass : public MachineFunctionPass {
8484

8585
private:
8686
/// Machine instruction info used throughout the class.
87-
const X86InstrInfo *TII;
87+
const X86InstrInfo *TII = nullptr;
8888
};
8989

9090
} // end anonymous namespace

llvm/lib/Target/X86/X86ExpandPseudo.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ class X86ExpandPseudo : public MachineFunctionPass {
4141
MachineFunctionPass::getAnalysisUsage(AU);
4242
}
4343

44-
const X86Subtarget *STI;
45-
const X86InstrInfo *TII;
46-
const X86RegisterInfo *TRI;
47-
const X86MachineFunctionInfo *X86FI;
48-
const X86FrameLowering *X86FL;
44+
const X86Subtarget *STI = nullptr;
45+
const X86InstrInfo *TII = nullptr;
46+
const X86RegisterInfo *TRI = nullptr;
47+
const X86MachineFunctionInfo *X86FI = nullptr;
48+
const X86FrameLowering *X86FL = nullptr;
4949

5050
bool runOnMachineFunction(MachineFunction &Fn) override;
5151

llvm/lib/Target/X86/X86FixupBWInsts.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,16 @@ class FixupBWInstPass : public MachineFunctionPass {
127127
}
128128

129129
private:
130-
MachineFunction *MF;
130+
MachineFunction *MF = nullptr;
131131

132132
/// Machine instruction info used throughout the class.
133-
const X86InstrInfo *TII;
133+
const X86InstrInfo *TII = nullptr;
134134

135135
/// Local member for function's OptForSize attribute.
136-
bool OptForSize;
136+
bool OptForSize = false;
137137

138138
/// Machine loop info used for guiding some heruistics.
139-
MachineLoopInfo *MLI;
139+
MachineLoopInfo *MLI = nullptr;
140140

141141
/// Register Liveness information after the current instruction.
142142
LivePhysRegs LiveRegs;

llvm/lib/Target/X86/X86FloatingPoint.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace {
8383
StringRef getPassName() const override { return "X86 FP Stackifier"; }
8484

8585
private:
86-
const TargetInstrInfo *TII; // Machine instruction info.
86+
const TargetInstrInfo *TII = nullptr; // Machine instruction info.
8787

8888
// Two CFG edges are related if they leave the same block, or enter the same
8989
// block. The transitive closure of an edge under this relation is a
@@ -119,7 +119,7 @@ namespace {
119119
SmallVector<LiveBundle, 8> LiveBundles;
120120

121121
// The edge bundle analysis provides indices into the LiveBundles vector.
122-
EdgeBundles *Bundles;
122+
EdgeBundles *Bundles = nullptr;
123123

124124
// Return a bitmask of FP registers in block's live-in list.
125125
static unsigned calcLiveInMask(MachineBasicBlock *MBB, bool RemoveFPs) {
@@ -143,14 +143,14 @@ namespace {
143143
// Partition all the CFG edges into LiveBundles.
144144
void bundleCFGRecomputeKillFlags(MachineFunction &MF);
145145

146-
MachineBasicBlock *MBB; // Current basic block
146+
MachineBasicBlock *MBB = nullptr; // Current basic block
147147

148148
// The hardware keeps track of how many FP registers are live, so we have
149149
// to model that exactly. Usually, each live register corresponds to an
150150
// FP<n> register, but when dealing with calls, returns, and inline
151151
// assembly, it is sometimes necessary to have live scratch registers.
152152
unsigned Stack[8]; // FP<n> Registers in each stack slot...
153-
unsigned StackTop; // The current top of the FP stack.
153+
unsigned StackTop = 0; // The current top of the FP stack.
154154

155155
enum {
156156
NumFPRegs = 8 // Including scratch pseudo-registers.

0 commit comments

Comments
 (0)