MSP430 - fix uninitialized variable warnings. NFCI.

This commit is contained in:
Simon Pilgrim 2019-11-14 13:32:40 +00:00
parent 1466335cf4
commit 9242b99451
3 changed files with 17 additions and 20 deletions

View File

@ -37,25 +37,22 @@ namespace {
enum {
RegBase,
FrameIndexBase
} BaseType;
} BaseType = RegBase;
struct { // This is really a union, discriminated by BaseType!
SDValue Reg;
int FrameIndex;
int FrameIndex = 0;
} Base;
int16_t Disp;
const GlobalValue *GV;
const Constant *CP;
const BlockAddress *BlockAddr;
const char *ES;
int JT;
unsigned Align; // CP alignment.
int16_t Disp = 0;
const GlobalValue *GV = nullptr;
const Constant *CP = nullptr;
const BlockAddress *BlockAddr = nullptr;
const char *ES = nullptr;
int JT = -1;
unsigned Align = 0; // CP alignment.
MSP430ISelAddressMode()
: BaseType(RegBase), Disp(0), GV(nullptr), CP(nullptr),
BlockAddr(nullptr), ES(nullptr), JT(-1), Align(0) {
}
MSP430ISelAddressMode() = default;
bool hasSymbolicDisplacement() const {
return GV != nullptr || CP != nullptr || ES != nullptr || JT != -1;

View File

@ -24,21 +24,21 @@ class MSP430MachineFunctionInfo : public MachineFunctionInfo {
/// CalleeSavedFrameSize - Size of the callee-saved register portion of the
/// stack frame in bytes.
unsigned CalleeSavedFrameSize;
unsigned CalleeSavedFrameSize = 0;
/// ReturnAddrIndex - FrameIndex for return slot.
int ReturnAddrIndex;
int ReturnAddrIndex = 0;
/// VarArgsFrameIndex - FrameIndex for start of varargs area.
int VarArgsFrameIndex;
int VarArgsFrameIndex = 0;
/// SRetReturnReg - Some subtargets require that sret lowering includes
/// returning the value of the returned struct in a register. This field
/// holds the virtual register into which the sret argument is passed.
unsigned SRetReturnReg;
unsigned SRetReturnReg = 0;
public:
MSP430MachineFunctionInfo() : CalleeSavedFrameSize(0) {}
MSP430MachineFunctionInfo() = default;
explicit MSP430MachineFunctionInfo(MachineFunction &MF)
: CalleeSavedFrameSize(0), ReturnAddrIndex(0), SRetReturnReg(0) {}

View File

@ -36,8 +36,8 @@ public:
private:
virtual void anchor();
bool ExtendedInsts;
HWMultEnum HWMultMode;
bool ExtendedInsts = false;
HWMultEnum HWMultMode = NoHWMult;
MSP430FrameLowering FrameLowering;
MSP430InstrInfo InstrInfo;
MSP430TargetLowering TLInfo;