From c0b475bd5ec9f4e4fefbb664ced4259ef17547b9 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Tue, 10 Jan 2023 17:48:37 -0800 Subject: [PATCH] [NFC][AVR] Use inline field initializers --- llvm/lib/Target/AVR/AVRSubtarget.cpp | 12 +--------- llvm/lib/Target/AVR/AVRSubtarget.h | 44 ++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/llvm/lib/Target/AVR/AVRSubtarget.cpp b/llvm/lib/Target/AVR/AVRSubtarget.cpp index 184ad439..c4e8d9a 100644 --- a/llvm/lib/Target/AVR/AVRSubtarget.cpp +++ b/llvm/lib/Target/AVR/AVRSubtarget.cpp @@ -29,17 +29,7 @@ namespace llvm { AVRSubtarget::AVRSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const AVRTargetMachine &TM) - : AVRGenSubtargetInfo(TT, CPU, /*TuneCPU*/ CPU, FS), ELFArch(0), - - // Subtarget features - m_hasSRAM(false), m_hasJMPCALL(false), m_hasIJMPCALL(false), - m_hasEIJMPCALL(false), m_hasADDSUBIW(false), m_hasSmallStack(false), - m_hasMOVW(false), m_hasLPM(false), m_hasLPMX(false), m_hasELPM(false), - m_hasELPMX(false), m_hasPROGMEM(false), m_hasSPM(false), m_hasSPMX(false), - m_hasDES(false), m_supportsRMW(false), m_supportsMultiplication(false), - m_hasBREAK(false), m_hasTinyEncoding(false), m_hasMemMappedGPR(false), - m_FeatureSetDummy(false), - + : AVRGenSubtargetInfo(TT, CPU, /*TuneCPU*/ CPU, FS), TLInfo(TM, initializeSubtargetDependencies(CPU, FS, TM)) { // Parse features string. ParseSubtargetFeatures(CPU, /*TuneCPU*/ CPU, FS); diff --git a/llvm/lib/Target/AVR/AVRSubtarget.h b/llvm/lib/Target/AVR/AVRSubtarget.h index 10ae4d2..25046e6 100644 --- a/llvm/lib/Target/AVR/AVRSubtarget.h +++ b/llvm/lib/Target/AVR/AVRSubtarget.h @@ -113,34 +113,34 @@ public: private: /// The ELF e_flags architecture. - unsigned ELFArch; + unsigned ELFArch = 0; // Subtarget feature settings // See AVR.td for details. - bool m_hasSRAM; - bool m_hasJMPCALL; - bool m_hasIJMPCALL; - bool m_hasEIJMPCALL; - bool m_hasADDSUBIW; - bool m_hasSmallStack; - bool m_hasMOVW; - bool m_hasLPM; - bool m_hasLPMX; - bool m_hasELPM; - bool m_hasELPMX; - bool m_hasPROGMEM; - bool m_hasSPM; - bool m_hasSPMX; - bool m_hasDES; - bool m_supportsRMW; - bool m_supportsMultiplication; - bool m_hasBREAK; - bool m_hasTinyEncoding; - bool m_hasMemMappedGPR; + bool m_hasSRAM = false; + bool m_hasJMPCALL = false; + bool m_hasIJMPCALL = false; + bool m_hasEIJMPCALL = false; + bool m_hasADDSUBIW = false; + bool m_hasSmallStack = false; + bool m_hasMOVW = false; + bool m_hasLPM = false; + bool m_hasLPMX = false; + bool m_hasELPM = false; + bool m_hasELPMX = false; + bool m_hasPROGMEM = false; + bool m_hasSPM = false; + bool m_hasSPMX = false; + bool m_hasDES = false; + bool m_supportsRMW = false; + bool m_supportsMultiplication = false; + bool m_hasBREAK = false; + bool m_hasTinyEncoding = false; + bool m_hasMemMappedGPR = false; // Dummy member, used by FeatureSet's. We cannot have a SubtargetFeature with // no variable, so we instead bind pseudo features to this variable. - bool m_FeatureSetDummy; + bool m_FeatureSetDummy = false; AVRInstrInfo InstrInfo; AVRFrameLowering FrameLowering; -- 2.7.4