diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-14 13:32:40 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-14 14:21:16 +0000 |
commit | 9242b994510d9a03e33790168a87161f8577f4e9 (patch) | |
tree | c47fad12c97d5e19df418b16be706d1572b0d307 | |
parent | 1466335cf4b2854a0be1defcf279fe50772bad6f (diff) | |
download | bcm5719-llvm-9242b994510d9a03e33790168a87161f8577f4e9.tar.gz bcm5719-llvm-9242b994510d9a03e33790168a87161f8577f4e9.zip |
MSP430 - fix uninitialized variable warnings. NFCI.
-rw-r--r-- | llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp | 25 | ||||
-rw-r--r-- | llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h | 10 | ||||
-rw-r--r-- | llvm/lib/Target/MSP430/MSP430Subtarget.h | 4 |
3 files changed, 18 insertions, 21 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp b/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp index 23449585505..8550230155c 100644 --- a/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp +++ b/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp @@ -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. - - MSP430ISelAddressMode() - : BaseType(RegBase), Disp(0), GV(nullptr), CP(nullptr), - BlockAddr(nullptr), ES(nullptr), JT(-1), Align(0) { - } + 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() = default; bool hasSymbolicDisplacement() const { return GV != nullptr || CP != nullptr || ES != nullptr || JT != -1; diff --git a/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h b/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h index 2b2c8967a74..712519cfe38 100644 --- a/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h +++ b/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h @@ -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) {} diff --git a/llvm/lib/Target/MSP430/MSP430Subtarget.h b/llvm/lib/Target/MSP430/MSP430Subtarget.h index ab2b71e3bb1..2348d984d7e 100644 --- a/llvm/lib/Target/MSP430/MSP430Subtarget.h +++ b/llvm/lib/Target/MSP430/MSP430Subtarget.h @@ -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; |