diff --git a/llvm/include/llvm/MC/MCAsmMacro.h b/llvm/include/llvm/MC/MCAsmMacro.h --- a/llvm/include/llvm/MC/MCAsmMacro.h +++ b/llvm/include/llvm/MC/MCAsmMacro.h @@ -63,7 +63,7 @@ }; private: - TokenKind Kind; + TokenKind Kind = TokenKind::Eof; /// A reference to the entire token contents; this is always a pointer into /// a memory buffer owned by the source manager. diff --git a/llvm/include/llvm/MC/MCDwarf.h b/llvm/include/llvm/MC/MCDwarf.h --- a/llvm/include/llvm/MC/MCDwarf.h +++ b/llvm/include/llvm/MC/MCDwarf.h @@ -506,7 +506,7 @@ int Offset; unsigned Register2; }; - unsigned AddressSpace; + unsigned AddressSpace = ~0u; std::vector Values; std::string Comment; diff --git a/llvm/include/llvm/MC/MCMachObjectWriter.h b/llvm/include/llvm/MC/MCMachObjectWriter.h --- a/llvm/include/llvm/MC/MCMachObjectWriter.h +++ b/llvm/include/llvm/MC/MCMachObjectWriter.h @@ -32,7 +32,7 @@ protected: uint32_t CPUSubtype; public: - unsigned LocalDifference_RIT; + unsigned LocalDifference_RIT = 0; protected: MCMachObjectTargetWriter(bool Is64Bit_, uint32_t CPUType_, diff --git a/llvm/include/llvm/MC/MCObjectStreamer.h b/llvm/include/llvm/MC/MCObjectStreamer.h --- a/llvm/include/llvm/MC/MCObjectStreamer.h +++ b/llvm/include/llvm/MC/MCObjectStreamer.h @@ -46,7 +46,7 @@ bool EmitDebugFrame; SmallVector PendingLabels; SmallSetVector PendingLabelSections; - unsigned CurSubsectionIdx; + unsigned CurSubsectionIdx = 0; struct PendingMCFixup { const MCSymbol *Sym; MCFixup Fixup; diff --git a/llvm/include/llvm/MC/MCParser/MCAsmLexer.h b/llvm/include/llvm/MC/MCParser/MCAsmLexer.h --- a/llvm/include/llvm/MC/MCParser/MCAsmLexer.h +++ b/llvm/include/llvm/MC/MCParser/MCAsmLexer.h @@ -45,7 +45,7 @@ protected: // Can only create subclasses. const char *TokStart = nullptr; bool SkipSpace = true; - bool AllowAtInIdentifier; + bool AllowAtInIdentifier = false; bool AllowHashInIdentifier = false; bool IsAtStartOfStatement = true; bool LexMasmHexFloats = false; diff --git a/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h b/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h --- a/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h +++ b/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h @@ -24,7 +24,7 @@ class MCParsedAsmOperand { /// MCOperandNum - The corresponding MCInst operand number. Only valid when /// parsing MS-style inline assembly. - unsigned MCOperandNum; + unsigned MCOperandNum = ~0u; /// Constraint - The constraint on this operand. Only valid when parsing /// MS-style inline assembly. diff --git a/llvm/include/llvm/MC/MCRegisterInfo.h b/llvm/include/llvm/MC/MCRegisterInfo.h --- a/llvm/include/llvm/MC/MCRegisterInfo.h +++ b/llvm/include/llvm/MC/MCRegisterInfo.h @@ -243,7 +243,7 @@ std::forward_iterator_tag, MCPhysReg> { MCRegisterInfo::DiffListIterator Iter; /// Current value as MCPhysReg, so we can return a reference to it. - MCPhysReg Val; + MCPhysReg Val = 0; protected: mc_difflist_iterator(MCRegisterInfo::DiffListIterator Iter) : Iter(Iter) {} diff --git a/llvm/include/llvm/MC/MCSection.h b/llvm/include/llvm/MC/MCSection.h --- a/llvm/include/llvm/MC/MCSection.h +++ b/llvm/include/llvm/MC/MCSection.h @@ -74,7 +74,7 @@ /// The section index in the assemblers section list. unsigned Ordinal = 0; /// The index of this section in the layout order. - unsigned LayoutOrder; + unsigned LayoutOrder = 0; /// Keeping track of bundle-locked state. BundleLockStateType BundleLockState = NotBundleLocked; diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -128,11 +128,11 @@ /// @} // This holds the symbol table index of the last local symbol. - unsigned LastLocalSymbolIndex; + unsigned LastLocalSymbolIndex = ~0u; // This holds the .strtab section index. - unsigned StringTableIndex; + unsigned StringTableIndex = ~0u; // This holds the .symtab section index. - unsigned SymbolTableIndex; + unsigned SymbolTableIndex = ~0u; // Sections in the order they are to be output in the section table. std::vector SectionTable; 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 @@ -79,7 +79,7 @@ using AuxiliarySymbols = SmallVector; name Name; - int Index; + int Index = 0; AuxiliarySymbols Aux; COFFSymbol *Other = nullptr; COFFSection *Section = nullptr; @@ -115,7 +115,7 @@ COFF::section Header = {}; std::string Name; - int Number; + int Number = 0; MCSectionCOFF const *MCSection = nullptr; COFFSymbol *Symbol = nullptr; relocations Relocations; diff --git a/llvm/lib/MC/XCOFFObjectWriter.cpp b/llvm/lib/MC/XCOFFObjectWriter.cpp --- a/llvm/lib/MC/XCOFFObjectWriter.cpp +++ b/llvm/lib/MC/XCOFFObjectWriter.cpp @@ -206,7 +206,7 @@ struct ExceptionTableEntry { const MCSymbol *Trap; - uint64_t TrapAddress; + uint64_t TrapAddress = ~0ul; unsigned Lang; unsigned Reason;