diff --git a/llvm/include/llvm/InterfaceStub/IFSStub.h b/llvm/include/llvm/InterfaceStub/IFSStub.h --- a/llvm/include/llvm/InterfaceStub/IFSStub.h +++ b/llvm/include/llvm/InterfaceStub/IFSStub.h @@ -54,9 +54,9 @@ explicit IFSSymbol(std::string SymbolName) : Name(std::move(SymbolName)) {} std::string Name; std::optional Size; - IFSSymbolType Type; - bool Undefined; - bool Weak; + IFSSymbolType Type = IFSSymbolType::NoType; + bool Undefined = false; + bool Weak = false; std::optional Warning; bool operator<(const IFSSymbol &RHS) const { return Name < RHS.Name; } }; diff --git a/llvm/include/llvm/Object/ELFObjectFile.h b/llvm/include/llvm/Object/ELFObjectFile.h --- a/llvm/include/llvm/Object/ELFObjectFile.h +++ b/llvm/include/llvm/Object/ELFObjectFile.h @@ -402,7 +402,7 @@ // This flag is used for classof, to distinguish ELFObjectFile from // its subclass. If more subclasses will be created, this flag will // have to become an enum. - bool isDyldELFObject; + bool isDyldELFObject = false; public: ELFObjectFile(ELFObjectFile &&Other); diff --git a/llvm/include/llvm/Object/WindowsResource.h b/llvm/include/llvm/Object/WindowsResource.h --- a/llvm/include/llvm/Object/WindowsResource.h +++ b/llvm/include/llvm/Object/WindowsResource.h @@ -234,7 +234,7 @@ struct StringOrID { bool IsString; ArrayRef String; - uint32_t ID; + uint32_t ID = ~0u; StringOrID(uint32_t ID) : IsString(false), ID(ID) {} StringOrID(ArrayRef String) : IsString(true), String(String) {} diff --git a/llvm/lib/ObjectYAML/XCOFFEmitter.cpp b/llvm/lib/ObjectYAML/XCOFFEmitter.cpp --- a/llvm/lib/ObjectYAML/XCOFFEmitter.cpp +++ b/llvm/lib/ObjectYAML/XCOFFEmitter.cpp @@ -70,7 +70,7 @@ support::endian::Writer W; yaml::ErrorHandler ErrHandler; StringTableBuilder StrTblBuilder; - uint64_t StartOffset; + uint64_t StartOffset = 0u; // Map the section name to its corrresponding section index. DenseMap SectionIndexMap = { {StringRef("N_DEBUG"), XCOFF::N_DEBUG}, diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp --- a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp @@ -127,7 +127,7 @@ MCInst PrevInst; MCBoundaryAlignFragment *PendingBA = nullptr; std::pair PrevInstPosition; - bool CanPadInst; + bool CanPadInst = false; uint8_t determinePaddingPrefix(const MCInst &Inst) const; bool isMacroFused(const MCInst &Cmp, const MCInst &Jcc) const;