diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp --- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp +++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp @@ -534,7 +534,7 @@ std::string ConversionFnKind; /// If this instruction is deprecated in some form. - bool HasDeprecation; + bool HasDeprecation = false; /// If this is an alias, this is use to determine whether or not to using /// the conversion function defined by the instruction's AsmMatchConverter diff --git a/llvm/utils/TableGen/CallingConvEmitter.cpp b/llvm/utils/TableGen/CallingConvEmitter.cpp --- a/llvm/utils/TableGen/CallingConvEmitter.cpp +++ b/llvm/utils/TableGen/CallingConvEmitter.cpp @@ -20,9 +20,9 @@ namespace { class CallingConvEmitter { RecordKeeper &Records; - unsigned Counter; + unsigned Counter = 0u; std::string CurrentAction; - bool SwiftAction; + bool SwiftAction = false; std::map> AssignedRegsMap; std::map> AssignedSwiftRegsMap; diff --git a/llvm/utils/TableGen/CodeEmitterGen.cpp b/llvm/utils/TableGen/CodeEmitterGen.cpp --- a/llvm/utils/TableGen/CodeEmitterGen.cpp +++ b/llvm/utils/TableGen/CodeEmitterGen.cpp @@ -56,8 +56,8 @@ void emitInstructionBaseValues( raw_ostream &o, ArrayRef NumberedInstructions, CodeGenTarget &Target, int HwMode = -1); - unsigned BitWidth; - bool UseAPInt; + unsigned BitWidth = 0u; + bool UseAPInt = false; }; // If the VarBitInit at position 'bit' matches the specified variable then diff --git a/llvm/utils/TableGen/CodeGenRegisters.h b/llvm/utils/TableGen/CodeGenRegisters.h --- a/llvm/utils/TableGen/CodeGenRegisters.h +++ b/llvm/utils/TableGen/CodeGenRegisters.h @@ -154,10 +154,10 @@ Record *TheDef; unsigned EnumValue; std::vector CostPerUse; - bool CoveredBySubRegs; - bool HasDisjunctSubRegs; - bool Artificial; - bool Constant; + bool CoveredBySubRegs = true; + bool HasDisjunctSubRegs = false; + bool Artificial = true; + bool Constant = false; // Map SubRegIndex -> Register. typedef std::map Next; - size_t Size; // Size in bytes of matcher and all its children (if any). + size_t Size = 0; // Size in bytes of matcher and all its children (if any). virtual void anchor(); public: enum KindTy { diff --git a/llvm/utils/TableGen/DXILEmitter.cpp b/llvm/utils/TableGen/DXILEmitter.cpp --- a/llvm/utils/TableGen/DXILEmitter.cpp +++ b/llvm/utils/TableGen/DXILEmitter.cpp @@ -26,8 +26,8 @@ namespace { struct DXILShaderModel { - int Major; - int Minor; + int Major = 0; + int Minor = 0; }; struct DXILParam { @@ -56,12 +56,13 @@ // memory,ro=only reads from memory StringRef Intrinsic; // The llvm intrinsic map to DXILOp. Default is "" which // means no map exist - bool IsDeriv; // whether this is some kind of derivative - bool IsGradient; // whether this requires a gradient calculation - bool IsFeedback; // whether this is a sampler feedback op - bool IsWave; // whether this requires in-wave, cross-lane functionality - bool RequiresUniformInputs; // whether this operation requires that all - // of its inputs are uniform across the wave + bool IsDeriv = false; // whether this is some kind of derivative + bool IsGradient = false; // whether this requires a gradient calculation + bool IsFeedback = false; // whether this is a sampler feedback op + bool IsWave = false; // whether this requires in-wave, cross-lane functionality + bool RequiresUniformInputs = false; // whether this operation requires that + // all of its inputs are uniform across + // the wave SmallVector ShaderStages; // shader stages to which this applies, empty for all. DXILShaderModel ShaderModel; // minimum shader model required diff --git a/llvm/utils/TableGen/OptParserEmitter.cpp b/llvm/utils/TableGen/OptParserEmitter.cpp --- a/llvm/utils/TableGen/OptParserEmitter.cpp +++ b/llvm/utils/TableGen/OptParserEmitter.cpp @@ -64,7 +64,7 @@ public: static constexpr const char *MacroName = "OPTION_WITH_MARSHALLING"; const Record &R; - bool ShouldAlwaysEmit; + bool ShouldAlwaysEmit = false; StringRef MacroPrefix; StringRef KeyPath; StringRef DefaultValue;