diff --git a/llvm/include/llvm/CodeGen/MachineSSAContext.h b/llvm/include/llvm/CodeGen/MachineSSAContext.h --- a/llvm/include/llvm/CodeGen/MachineSSAContext.h +++ b/llvm/include/llvm/CodeGen/MachineSSAContext.h @@ -36,7 +36,7 @@ template <> class GenericSSAContext { const MachineRegisterInfo *RegInfo = nullptr; - MachineFunction *MF; + MachineFunction *MF = nullptr; public: using BlockT = MachineBasicBlock; diff --git a/llvm/include/llvm/MC/MCContext.h b/llvm/include/llvm/MC/MCContext.h --- a/llvm/include/llvm/MC/MCContext.h +++ b/llvm/include/llvm/MC/MCContext.h @@ -101,7 +101,7 @@ Triple TT; /// The SourceMgr for this object, if any. - const SourceMgr *SrcMgr; + const SourceMgr *SrcMgr = nullptr; /// The SourceMgr for inline assembly, if any. std::unique_ptr InlineSrcMgr; @@ -110,16 +110,16 @@ DiagHandlerTy DiagHandler; /// The MCAsmInfo for this target. - const MCAsmInfo *MAI; + const MCAsmInfo *MAI = nullptr; /// The MCRegisterInfo for this target. - const MCRegisterInfo *MRI; + const MCRegisterInfo *MRI = nullptr; /// The MCObjectFileInfo for this target. - const MCObjectFileInfo *MOFI; + const MCObjectFileInfo *MOFI = nullptr; /// The MCSubtargetInfo for this target. - const MCSubtargetInfo *MSTI; + const MCSubtargetInfo *MSTI = nullptr; std::unique_ptr CVContext; diff --git a/llvm/include/llvm/MC/MCFragment.h b/llvm/include/llvm/MC/MCFragment.h --- a/llvm/include/llvm/MC/MCFragment.h +++ b/llvm/include/llvm/MC/MCFragment.h @@ -311,7 +311,7 @@ unsigned MaxBytesToEmit; /// When emitting Nops some subtargets have specific nop encodings. - const MCSubtargetInfo *STI; + const MCSubtargetInfo *STI = nullptr; public: MCAlignFragment(Align Alignment, int64_t Value, unsigned ValueSize, diff --git a/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h b/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h --- a/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h +++ b/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h @@ -22,7 +22,7 @@ /// which is implemented by target and object file assembly parser /// implementations. class MCAsmParserExtension { - MCAsmParser *Parser; + MCAsmParser *Parser = nullptr; protected: MCAsmParserExtension(); diff --git a/llvm/include/llvm/MC/MCPseudoProbe.h b/llvm/include/llvm/MC/MCPseudoProbe.h --- a/llvm/include/llvm/MC/MCPseudoProbe.h +++ b/llvm/include/llvm/MC/MCPseudoProbe.h @@ -235,7 +235,8 @@ std::vector &getProbes() { return Probes; } void addProbes(ProbeType Probe) { Probes.push_back(Probe); } // Caller node of the inline site - MCPseudoProbeInlineTreeBase *Parent; + MCPseudoProbeInlineTreeBase *Parent = + nullptr; DerivedProbeInlineTreeType *getOrAddNode(const InlineSite &Site) { auto Ret = Children.emplace( Site, std::make_unique(Site)); diff --git a/llvm/include/llvm/MC/MCWinEH.h b/llvm/include/llvm/MC/MCWinEH.h --- a/llvm/include/llvm/MC/MCWinEH.h +++ b/llvm/include/llvm/MC/MCWinEH.h @@ -68,7 +68,7 @@ int64_t Offset; int64_t Length; bool HasProlog; - MCSymbol *Symbol; + MCSymbol *Symbol = nullptr; // Map an Epilog's symbol to its offset within the function. MapVector Epilogs; diff --git a/llvm/include/llvm/Object/COFF.h b/llvm/include/llvm/Object/COFF.h --- a/llvm/include/llvm/Object/COFF.h +++ b/llvm/include/llvm/Object/COFF.h @@ -1259,7 +1259,7 @@ BinaryByteStream BBS; SectionRef Section; - const COFFObjectFile *Obj; + const COFFObjectFile *Obj = nullptr; std::vector Relocs; diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp --- a/llvm/lib/MC/WasmObjectWriter.cpp +++ b/llvm/lib/MC/WasmObjectWriter.cpp @@ -197,7 +197,7 @@ } class WasmObjectWriter : public MCObjectWriter { - support::endian::Writer *W; + support::endian::Writer *W = nullptr; /// The target specific Wasm writer instance. std::unique_ptr TargetObjectWriter; diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp --- a/llvm/lib/MC/WinCOFFObjectWriter.cpp +++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp @@ -154,7 +154,7 @@ bool UseBigObj; bool UseOffsetLabels = false; - MCSectionCOFF *AddrsigSection; + MCSectionCOFF *AddrsigSection = nullptr; MCSectionCOFF *CGProfileSection = nullptr;