diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h --- a/llvm/include/llvm/CodeGen/AsmPrinter.h +++ b/llvm/include/llvm/CodeGen/AsmPrinter.h @@ -87,7 +87,7 @@ TargetMachine &TM; /// Target Asm Printer information. - const MCAsmInfo *MAI; + const MCAsmInfo *MAI = nullptr; /// This is the context for the output file that we are streaming. This owns /// all of the global MC-related objects for the generated translation unit. @@ -111,7 +111,7 @@ MachineLoopInfo *MLI = nullptr; /// Optimization remark emitter. - MachineOptimizationRemarkEmitter *ORE; + MachineOptimizationRemarkEmitter *ORE = nullptr; /// The symbol for the entry in __patchable_function_entires. MCSymbol *CurrentPatchableFunctionEntrySym = nullptr; diff --git a/llvm/include/llvm/CodeGen/DebugHandlerBase.h b/llvm/include/llvm/CodeGen/DebugHandlerBase.h --- a/llvm/include/llvm/CodeGen/DebugHandlerBase.h +++ b/llvm/include/llvm/CodeGen/DebugHandlerBase.h @@ -55,10 +55,10 @@ DebugHandlerBase(AsmPrinter *A); /// Target of debug info emission. - AsmPrinter *Asm; + AsmPrinter *Asm = nullptr; /// Collected machine module information. - MachineModuleInfo *MMI; + MachineModuleInfo *MMI = nullptr; /// Previous instruction's location information. This is used to /// determine label location to indicate scope boundaries in debug info. @@ -73,7 +73,7 @@ DebugLoc PrologEndLoc; /// This block includes epilogue instructions. - const MachineBasicBlock *EpilogBeginBlock; + const MachineBasicBlock *EpilogBeginBlock = nullptr; /// If nonnull, stores the current machine instruction we're processing. const MachineInstr *CurMI = nullptr; diff --git a/llvm/include/llvm/CodeGen/EdgeBundles.h b/llvm/include/llvm/CodeGen/EdgeBundles.h --- a/llvm/include/llvm/CodeGen/EdgeBundles.h +++ b/llvm/include/llvm/CodeGen/EdgeBundles.h @@ -22,7 +22,7 @@ namespace llvm { class EdgeBundles : public MachineFunctionPass { - const MachineFunction *MF; + const MachineFunction *MF = nullptr; /// EC - Each edge bundle is an equivalence class. The keys are: /// 2*BB->getNumber() -> Ingoing bundle. diff --git a/llvm/include/llvm/CodeGen/ExecutionDomainFix.h b/llvm/include/llvm/CodeGen/ExecutionDomainFix.h --- a/llvm/include/llvm/CodeGen/ExecutionDomainFix.h +++ b/llvm/include/llvm/CodeGen/ExecutionDomainFix.h @@ -118,9 +118,9 @@ SmallVector Avail; const TargetRegisterClass *const RC; - MachineFunction *MF; - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; + MachineFunction *MF = nullptr; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; std::vector> AliasMap; const unsigned NumRegs; /// Value currently in each register, or NULL when no value is being tracked. @@ -133,7 +133,7 @@ using OutRegsInfoMap = SmallVector; OutRegsInfoMap MBBOutRegsInfos; - ReachingDefAnalysis *RDA; + ReachingDefAnalysis *RDA = nullptr; public: ExecutionDomainFix(char &PassID, const TargetRegisterClass &RC) diff --git a/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h b/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h --- a/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h @@ -67,7 +67,7 @@ private: /// Interface used to lower the everything related to calls. - const CallLowering *CLI; + const CallLowering *CLI = nullptr; /// This class contains the mapping between the Values to vreg related data. class ValueToVRegInfo { @@ -553,24 +553,24 @@ std::unique_ptr EntryBuilder; // The MachineFunction currently being translated. - MachineFunction *MF; + MachineFunction *MF = nullptr; /// MachineRegisterInfo used to create virtual registers. MachineRegisterInfo *MRI = nullptr; - const DataLayout *DL; + const DataLayout *DL = nullptr; /// Current target configuration. Controls how the pass handles errors. - const TargetPassConfig *TPC; + const TargetPassConfig *TPC = nullptr; CodeGenOpt::Level OptLevel; /// Current optimization remark emitter. Used to report failures. std::unique_ptr ORE; - AAResults *AA; - AssumptionCache *AC; - const TargetLibraryInfo *LibInfo; + AAResults *AA = nullptr; + AssumptionCache *AC = nullptr; + const TargetLibraryInfo *LibInfo = nullptr; FunctionLoweringInfo FuncInfo; // True when either the Target Machine specifies no optimizations or the diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h b/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h --- a/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h @@ -69,11 +69,11 @@ /// on the given MachineFunction. std::function DoNotRunPass; - MachineRegisterInfo *MRI; - const TargetLowering *TLI; - MachineFunction *MF; - AliasAnalysis *AA; - const LegalizerInfo *LI; + MachineRegisterInfo *MRI = nullptr; + const TargetLowering *TLI = nullptr; + MachineFunction *MF = nullptr; + AliasAnalysis *AA = nullptr; + const LegalizerInfo *LI = nullptr; MachineIRBuilder Builder; diff --git a/llvm/include/llvm/CodeGen/GlobalISel/Localizer.h b/llvm/include/llvm/CodeGen/GlobalISel/Localizer.h --- a/llvm/include/llvm/CodeGen/GlobalISel/Localizer.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/Localizer.h @@ -51,9 +51,9 @@ /// MRI contains all the register class/bank information that this /// pass uses and updates. - MachineRegisterInfo *MRI; + MachineRegisterInfo *MRI = nullptr; /// TTI used for getting remat costs for instructions. - TargetTransformInfo *TTI; + TargetTransformInfo *TTI = nullptr; /// Check if \p MOUse is used in the same basic block as \p Def. /// If the use is in the same block, we say it is local. diff --git a/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h b/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h --- a/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h +++ b/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h @@ -31,7 +31,7 @@ class LatencyPriorityQueue : public SchedulingPriorityQueue { // SUnits - The SUnits for the current graph. - std::vector *SUnits; + std::vector *SUnits = nullptr; /// NumNodesSolelyBlocking - This vector contains, for every node in the /// Queue, the number of nodes that the node is the sole unscheduled diff --git a/llvm/include/llvm/CodeGen/LiveIntervals.h b/llvm/include/llvm/CodeGen/LiveIntervals.h --- a/llvm/include/llvm/CodeGen/LiveIntervals.h +++ b/llvm/include/llvm/CodeGen/LiveIntervals.h @@ -51,11 +51,11 @@ class VirtRegMap; class LiveIntervals : public MachineFunctionPass { - MachineFunction* MF; - MachineRegisterInfo* MRI; - const TargetRegisterInfo* TRI; - const TargetInstrInfo *TII; - SlotIndexes* Indexes; + MachineFunction *MF = nullptr; + MachineRegisterInfo *MRI = nullptr; + const TargetRegisterInfo *TRI = nullptr; + const TargetInstrInfo *TII = nullptr; + SlotIndexes *Indexes = nullptr; MachineDominatorTree *DomTree = nullptr; LiveIntervalCalc *LICalc = nullptr; diff --git a/llvm/include/llvm/CodeGen/LiveRegMatrix.h b/llvm/include/llvm/CodeGen/LiveRegMatrix.h --- a/llvm/include/llvm/CodeGen/LiveRegMatrix.h +++ b/llvm/include/llvm/CodeGen/LiveRegMatrix.h @@ -38,9 +38,9 @@ class VirtRegMap; class LiveRegMatrix : public MachineFunctionPass { - const TargetRegisterInfo *TRI; - LiveIntervals *LIS; - VirtRegMap *VRM; + const TargetRegisterInfo *TRI = nullptr; + LiveIntervals *LIS = nullptr; + VirtRegMap *VRM = nullptr; // UserTag changes whenever virtual registers have been modified. unsigned UserTag = 0; diff --git a/llvm/include/llvm/CodeGen/LiveStacks.h b/llvm/include/llvm/CodeGen/LiveStacks.h --- a/llvm/include/llvm/CodeGen/LiveStacks.h +++ b/llvm/include/llvm/CodeGen/LiveStacks.h @@ -33,7 +33,7 @@ class TargetRegisterInfo; class LiveStacks : public MachineFunctionPass { - const TargetRegisterInfo *TRI; + const TargetRegisterInfo *TRI = nullptr; /// Special pool allocator for VNInfo's (LiveInterval val#). /// diff --git a/llvm/include/llvm/CodeGen/LiveVariables.h b/llvm/include/llvm/CodeGen/LiveVariables.h --- a/llvm/include/llvm/CodeGen/LiveVariables.h +++ b/llvm/include/llvm/CodeGen/LiveVariables.h @@ -124,11 +124,11 @@ SparseBitVector<> PHIJoins; private: // Intermediate data structures - MachineFunction *MF; + MachineFunction *MF = nullptr; - MachineRegisterInfo* MRI; + MachineRegisterInfo *MRI = nullptr; - const TargetRegisterInfo *TRI; + const TargetRegisterInfo *TRI = nullptr; // PhysRegInfo - Keep track of which instruction was the last def of a // physical register. This is a purely local property, because all physical diff --git a/llvm/include/llvm/CodeGen/MIRFSDiscriminator.h b/llvm/include/llvm/CodeGen/MIRFSDiscriminator.h --- a/llvm/include/llvm/CodeGen/MIRFSDiscriminator.h +++ b/llvm/include/llvm/CodeGen/MIRFSDiscriminator.h @@ -30,7 +30,7 @@ using namespace sampleprof; class MIRAddFSDiscriminators : public MachineFunctionPass { - MachineFunction *MF; + MachineFunction *MF = nullptr; unsigned LowBit; unsigned HighBit; diff --git a/llvm/include/llvm/CodeGen/MachineModuleInfo.h b/llvm/include/llvm/CodeGen/MachineModuleInfo.h --- a/llvm/include/llvm/CodeGen/MachineModuleInfo.h +++ b/llvm/include/llvm/CodeGen/MachineModuleInfo.h @@ -84,7 +84,7 @@ MCContext *ExternalContext = nullptr; /// This is the LLVM Module being worked on. - const Module *TheModule; + const Module *TheModule = nullptr; /// This is the object-file-format-specific implementation of /// MachineModuleInfoImpl, which lets targets accumulate whatever info they diff --git a/llvm/include/llvm/CodeGen/MachinePipeliner.h b/llvm/include/llvm/CodeGen/MachinePipeliner.h --- a/llvm/include/llvm/CodeGen/MachinePipeliner.h +++ b/llvm/include/llvm/CodeGen/MachinePipeliner.h @@ -69,7 +69,7 @@ MachineOptimizationRemarkEmitter *ORE = nullptr; const MachineLoopInfo *MLI = nullptr; const MachineDominatorTree *MDT = nullptr; - const InstrItineraryData *InstrItins; + const InstrItineraryData *InstrItins = nullptr; const TargetInstrInfo *TII = nullptr; RegisterClassInfo RegClassInfo; bool disabledByPragma = false; diff --git a/llvm/include/llvm/CodeGen/MachineSSAUpdater.h b/llvm/include/llvm/CodeGen/MachineSSAUpdater.h --- a/llvm/include/llvm/CodeGen/MachineSSAUpdater.h +++ b/llvm/include/llvm/CodeGen/MachineSSAUpdater.h @@ -41,14 +41,14 @@ void *AV = nullptr; /// VRC - Register class of the current virtual register. - const TargetRegisterClass *VRC; + const TargetRegisterClass *VRC = nullptr; /// InsertedPHIs - If this is non-null, the MachineSSAUpdater adds all PHI /// nodes that it creates to the vector. SmallVectorImpl *InsertedPHIs; - const TargetInstrInfo *TII; - MachineRegisterInfo *MRI; + const TargetInstrInfo *TII = nullptr; + MachineRegisterInfo *MRI = nullptr; public: /// MachineSSAUpdater constructor. If InsertedPHIs is specified, it will be diff --git a/llvm/include/llvm/CodeGen/ModuloSchedule.h b/llvm/include/llvm/CodeGen/ModuloSchedule.h --- a/llvm/include/llvm/CodeGen/ModuloSchedule.h +++ b/llvm/include/llvm/CodeGen/ModuloSchedule.h @@ -170,11 +170,11 @@ MachineFunction &MF; const TargetSubtargetInfo &ST; MachineRegisterInfo &MRI; - const TargetInstrInfo *TII; + const TargetInstrInfo *TII = nullptr; LiveIntervals &LIS; - MachineBasicBlock *BB; - MachineBasicBlock *Preheader; + MachineBasicBlock *BB = nullptr; + MachineBasicBlock *Preheader = nullptr; MachineBasicBlock *NewKernel = nullptr; std::unique_ptr LoopInfo; @@ -297,13 +297,13 @@ MachineFunction &MF; const TargetSubtargetInfo &ST; MachineRegisterInfo &MRI; - const TargetInstrInfo *TII; - LiveIntervals *LIS; + const TargetInstrInfo *TII = nullptr; + LiveIntervals *LIS = nullptr; /// The original loop block that gets rewritten in-place. - MachineBasicBlock *BB; + MachineBasicBlock *BB = nullptr; /// The original loop preheader. - MachineBasicBlock *Preheader; + MachineBasicBlock *Preheader = nullptr; /// All prolog and epilog blocks. SmallVector Prologs, Epilogs; /// For every block, the stages that are produced. diff --git a/llvm/include/llvm/CodeGen/ReachingDefAnalysis.h b/llvm/include/llvm/CodeGen/ReachingDefAnalysis.h --- a/llvm/include/llvm/CodeGen/ReachingDefAnalysis.h +++ b/llvm/include/llvm/CodeGen/ReachingDefAnalysis.h @@ -68,8 +68,8 @@ /// This class provides the reaching def analysis. class ReachingDefAnalysis : public MachineFunctionPass { private: - MachineFunction *MF; - const TargetRegisterInfo *TRI; + MachineFunction *MF = nullptr; + const TargetRegisterInfo *TRI = nullptr; LoopTraversal::TraversalOrder TraversedMBBOrder; unsigned NumRegUnits; /// Instruction that defined each register, relative to the beginning of the diff --git a/llvm/include/llvm/CodeGen/RegisterScavenging.h b/llvm/include/llvm/CodeGen/RegisterScavenging.h --- a/llvm/include/llvm/CodeGen/RegisterScavenging.h +++ b/llvm/include/llvm/CodeGen/RegisterScavenging.h @@ -32,9 +32,9 @@ class TargetRegisterInfo; class RegScavenger { - const TargetRegisterInfo *TRI; - const TargetInstrInfo *TII; - MachineRegisterInfo* MRI; + const TargetRegisterInfo *TRI = nullptr; + const TargetInstrInfo *TII = nullptr; + MachineRegisterInfo *MRI = nullptr; MachineBasicBlock *MBB = nullptr; MachineBasicBlock::iterator MBBI; unsigned NumRegUnits = 0; diff --git a/llvm/include/llvm/CodeGen/RegisterUsageInfo.h b/llvm/include/llvm/CodeGen/RegisterUsageInfo.h --- a/llvm/include/llvm/CodeGen/RegisterUsageInfo.h +++ b/llvm/include/llvm/CodeGen/RegisterUsageInfo.h @@ -63,7 +63,7 @@ /// and 1 means content of register will be preserved around function call. DenseMap> RegMasks; - const LLVMTargetMachine *TM; + const LLVMTargetMachine *TM = nullptr; }; } // end namespace llvm diff --git a/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h b/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h --- a/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h +++ b/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h @@ -119,7 +119,7 @@ /// A ScheduleDAG for scheduling lists of MachineInstr. class ScheduleDAGInstrs : public ScheduleDAG { protected: - const MachineLoopInfo *MLI; + const MachineLoopInfo *MLI = nullptr; const MachineFrameInfo &MFI; /// TargetSchedModel provides an interface to the machine model. @@ -143,7 +143,7 @@ // ------------------------------------------------ /// The block in which to insert instructions - MachineBasicBlock *BB; + MachineBasicBlock *BB = nullptr; /// The beginning of the range to be scheduled. MachineBasicBlock::iterator RegionBegin; diff --git a/llvm/include/llvm/CodeGen/StackProtector.h b/llvm/include/llvm/CodeGen/StackProtector.h --- a/llvm/include/llvm/CodeGen/StackProtector.h +++ b/llvm/include/llvm/CodeGen/StackProtector.h @@ -49,8 +49,8 @@ const TargetLoweringBase *TLI = nullptr; Triple Trip; - Function *F; - Module *M; + Function *F = nullptr; + Module *M = nullptr; std::optional DTU; diff --git a/llvm/include/llvm/CodeGen/SwitchLoweringUtils.h b/llvm/include/llvm/CodeGen/SwitchLoweringUtils.h --- a/llvm/include/llvm/CodeGen/SwitchLoweringUtils.h +++ b/llvm/include/llvm/CodeGen/SwitchLoweringUtils.h @@ -237,11 +237,11 @@ unsigned First, unsigned Last); struct SwitchWorkListItem { - MachineBasicBlock *MBB; + MachineBasicBlock *MBB = nullptr; CaseClusterIt FirstCluster; CaseClusterIt LastCluster; - const ConstantInt *GE; - const ConstantInt *LT; + const ConstantInt *GE = nullptr; + const ConstantInt *LT = nullptr; BranchProbability DefaultProb; }; using SwitchWorkList = SmallVector; @@ -292,9 +292,9 @@ virtual ~SwitchLowering() = default; private: - const TargetLowering *TLI; - const TargetMachine *TM; - const DataLayout *DL; + const TargetLowering *TLI = nullptr; + const TargetMachine *TM = nullptr; + const DataLayout *DL = nullptr; FunctionLoweringInfo &FuncInfo; }; diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h --- a/llvm/include/llvm/CodeGen/TargetLowering.h +++ b/llvm/include/llvm/CodeGen/TargetLowering.h @@ -3318,7 +3318,7 @@ /// register class is the largest legal super-reg register class of the /// register class of the specified type. e.g. On x86, i8, i16, and i32's /// representative class would be GR32. - const TargetRegisterClass *RepRegClassForVT[MVT::VALUETYPE_SIZE]; + const TargetRegisterClass *RepRegClassForVT[MVT::VALUETYPE_SIZE] = {0}; /// This indicates the "cost" of the "representative" register class for each /// ValueType. The cost is used by the scheduler to approximate register diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h b/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h --- a/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h +++ b/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h @@ -49,7 +49,7 @@ SmallVector Entries; SmallString<256> DWARFBytes; std::vector Comments; - MCSymbol *Sym; + MCSymbol *Sym = nullptr; /// Only verbose textual output needs comments. This will be set to /// true for that case, and false otherwise. diff --git a/llvm/lib/CodeGen/BranchFolding.h b/llvm/lib/CodeGen/BranchFolding.h --- a/llvm/lib/CodeGen/BranchFolding.h +++ b/llvm/lib/CodeGen/BranchFolding.h @@ -118,10 +118,10 @@ bool EnableHoistCommonCode; bool UpdateLiveIns; unsigned MinCommonTailLength; - const TargetInstrInfo *TII; - const MachineRegisterInfo *MRI; - const TargetRegisterInfo *TRI; - MachineLoopInfo *MLI; + const TargetInstrInfo *TII = nullptr; + const MachineRegisterInfo *MRI = nullptr; + const TargetRegisterInfo *TRI = nullptr; + MachineLoopInfo *MLI = nullptr; LivePhysRegs LiveRegs; private: diff --git a/llvm/lib/CodeGen/BranchRelaxation.cpp b/llvm/lib/CodeGen/BranchRelaxation.cpp --- a/llvm/lib/CodeGen/BranchRelaxation.cpp +++ b/llvm/lib/CodeGen/BranchRelaxation.cpp @@ -81,9 +81,9 @@ std::unique_ptr RS; LivePhysRegs LiveRegs; - MachineFunction *MF; - const TargetRegisterInfo *TRI; - const TargetInstrInfo *TII; + MachineFunction *MF = nullptr; + const TargetRegisterInfo *TRI = nullptr; + const TargetInstrInfo *TII = nullptr; bool relaxBranchInstructions(); void scanFunction(); diff --git a/llvm/lib/CodeGen/BreakFalseDeps.cpp b/llvm/lib/CodeGen/BreakFalseDeps.cpp --- a/llvm/lib/CodeGen/BreakFalseDeps.cpp +++ b/llvm/lib/CodeGen/BreakFalseDeps.cpp @@ -34,9 +34,9 @@ class BreakFalseDeps : public MachineFunctionPass { private: - MachineFunction *MF; - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; + MachineFunction *MF = nullptr; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; RegisterClassInfo RegClassInfo; /// List of undefined register reads in this block in forward order. @@ -45,7 +45,7 @@ /// Storage for register unit liveness. LivePhysRegs LiveRegSet; - ReachingDefAnalysis *RDA; + ReachingDefAnalysis *RDA = nullptr; public: static char ID; // Pass identification, replacement for typeid diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -298,16 +298,16 @@ class CodeGenPrepare : public FunctionPass { const TargetMachine *TM = nullptr; - const TargetSubtargetInfo *SubtargetInfo; + const TargetSubtargetInfo *SubtargetInfo = nullptr; const TargetLowering *TLI = nullptr; - const TargetRegisterInfo *TRI; + const TargetRegisterInfo *TRI = nullptr; const TargetTransformInfo *TTI = nullptr; const BasicBlockSectionsProfileReader *BBSectionsProfileReader = nullptr; - const TargetLibraryInfo *TLInfo; - const LoopInfo *LI; + const TargetLibraryInfo *TLInfo = nullptr; + const LoopInfo *LI = nullptr; std::unique_ptr BFI; std::unique_ptr BPI; - ProfileSummaryInfo *PSI; + ProfileSummaryInfo *PSI = nullptr; /// As we scan instructions optimizing them, this is the next instruction /// to optimize. Transforms that can invalidate this should update it. diff --git a/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp b/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp --- a/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp +++ b/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp @@ -197,8 +197,8 @@ explicit ComplexDeinterleavingGraph(const TargetLowering *tl) : TL(tl) {} private: - const TargetLowering *TL; - Instruction *RootValue; + const TargetLowering *TL = nullptr; + Instruction *RootValue = nullptr; NodePtr RootNode; SmallVector CompositeNodes; SmallPtrSet AllInstructions; diff --git a/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp b/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp --- a/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp +++ b/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp @@ -31,8 +31,8 @@ class DeadMachineInstructionElim : public MachineFunctionPass { bool runOnMachineFunction(MachineFunction &MF) override; - const MachineRegisterInfo *MRI; - const TargetInstrInfo *TII; + const MachineRegisterInfo *MRI = nullptr; + const TargetInstrInfo *TII = nullptr; LiveRegUnits LivePhysRegs; public: diff --git a/llvm/lib/CodeGen/DetectDeadLanes.cpp b/llvm/lib/CodeGen/DetectDeadLanes.cpp --- a/llvm/lib/CodeGen/DetectDeadLanes.cpp +++ b/llvm/lib/CodeGen/DetectDeadLanes.cpp @@ -403,8 +403,8 @@ bool isUndefInput(const DeadLaneDetector &DLD, const MachineOperand &MO, bool *CrossCopy) const; - const MachineRegisterInfo *MRI; - const TargetRegisterInfo *TRI; + const MachineRegisterInfo *MRI = nullptr; + const TargetRegisterInfo *TRI = nullptr; }; } // end anonymous namespace diff --git a/llvm/lib/CodeGen/EarlyIfConversion.cpp b/llvm/lib/CodeGen/EarlyIfConversion.cpp --- a/llvm/lib/CodeGen/EarlyIfConversion.cpp +++ b/llvm/lib/CodeGen/EarlyIfConversion.cpp @@ -760,14 +760,14 @@ namespace { class EarlyIfConverter : public MachineFunctionPass { - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; MCSchedModel SchedModel; - MachineRegisterInfo *MRI; - MachineDominatorTree *DomTree; - MachineLoopInfo *Loops; - MachineTraceMetrics *Traces; - MachineTraceMetrics::Ensemble *MinInstr; + MachineRegisterInfo *MRI = nullptr; + MachineDominatorTree *DomTree = nullptr; + MachineLoopInfo *Loops = nullptr; + MachineTraceMetrics *Traces = nullptr; + MachineTraceMetrics::Ensemble *MinInstr = nullptr; SSAIfConv IfConv; public: @@ -1084,13 +1084,13 @@ namespace { class EarlyIfPredicator : public MachineFunctionPass { - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; TargetSchedModel SchedModel; - MachineRegisterInfo *MRI; - MachineDominatorTree *DomTree; - MachineBranchProbabilityInfo *MBPI; - MachineLoopInfo *Loops; + MachineRegisterInfo *MRI = nullptr; + MachineDominatorTree *DomTree = nullptr; + MachineBranchProbabilityInfo *MBPI = nullptr; + MachineLoopInfo *Loops = nullptr; SSAIfConv IfConv; public: diff --git a/llvm/lib/CodeGen/ExpandMemCmp.cpp b/llvm/lib/CodeGen/ExpandMemCmp.cpp --- a/llvm/lib/CodeGen/ExpandMemCmp.cpp +++ b/llvm/lib/CodeGen/ExpandMemCmp.cpp @@ -71,7 +71,7 @@ ResultBlock() = default; }; - CallInst *const CI; + CallInst *const CI = nullptr; ResultBlock ResBlock; const uint64_t Size; unsigned MaxLoadSize = 0; @@ -82,7 +82,7 @@ PHINode *PhiRes = nullptr; const bool IsUsedForZeroCmp; const DataLayout &DL; - DomTreeUpdater *DTU; + DomTreeUpdater *DTU = nullptr; IRBuilder<> Builder; // Represents the decomposition in blocks of the expansion. For example, // comparing 33 bytes on X86+sse can be done with 2x16-byte loads and diff --git a/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp b/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp --- a/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp +++ b/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp @@ -28,8 +28,8 @@ namespace { struct ExpandPostRA : public MachineFunctionPass { private: - const TargetRegisterInfo *TRI; - const TargetInstrInfo *TII; + const TargetRegisterInfo *TRI = nullptr; + const TargetInstrInfo *TII = nullptr; public: static char ID; // Pass identification, replacement for typeid diff --git a/llvm/lib/CodeGen/GCRootLowering.cpp b/llvm/lib/CodeGen/GCRootLowering.cpp --- a/llvm/lib/CodeGen/GCRootLowering.cpp +++ b/llvm/lib/CodeGen/GCRootLowering.cpp @@ -52,8 +52,8 @@ /// in the machine code. It inserts labels at safe points and populates a /// GCMetadata record for each function. class GCMachineCodeAnalysis : public MachineFunctionPass { - GCFunctionInfo *FI; - const TargetInstrInfo *TII; + GCFunctionInfo *FI = nullptr; + const TargetInstrInfo *TII = nullptr; void FindSafePoints(MachineFunction &MF); void VisitCallPoint(MachineBasicBlock::iterator CI); diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp --- a/llvm/lib/CodeGen/IfConversion.cpp +++ b/llvm/lib/CodeGen/IfConversion.cpp @@ -189,11 +189,11 @@ std::vector BBAnalysis; TargetSchedModel SchedModel; - const TargetLoweringBase *TLI; - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; - const MachineBranchProbabilityInfo *MBPI; - MachineRegisterInfo *MRI; + const TargetLoweringBase *TLI = nullptr; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; + const MachineBranchProbabilityInfo *MBPI = nullptr; + MachineRegisterInfo *MRI = nullptr; LivePhysRegs Redefs; diff --git a/llvm/lib/CodeGen/InlineSpiller.cpp b/llvm/lib/CodeGen/InlineSpiller.cpp --- a/llvm/lib/CodeGen/InlineSpiller.cpp +++ b/llvm/lib/CodeGen/InlineSpiller.cpp @@ -165,8 +165,8 @@ const MachineBlockFrequencyInfo &MBFI; // Variables that are valid during spill(), but used by multiple methods. - LiveRangeEdit *Edit; - LiveInterval *StackInt; + LiveRangeEdit *Edit = nullptr; + LiveInterval *StackInt = nullptr; int StackSlot; Register Original; diff --git a/llvm/lib/CodeGen/InterferenceCache.h b/llvm/lib/CodeGen/InterferenceCache.h --- a/llvm/lib/CodeGen/InterferenceCache.h +++ b/llvm/lib/CodeGen/InterferenceCache.h @@ -54,7 +54,7 @@ unsigned RefCount = 0; /// MF - The current function. - MachineFunction *MF; + MachineFunction *MF = nullptr; /// Indexes - Mapping block numbers to SlotIndex ranges. SlotIndexes *Indexes = nullptr; diff --git a/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp b/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp --- a/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp @@ -81,7 +81,7 @@ private: std::unique_ptr InstrRefImpl; std::unique_ptr VarLocImpl; - TargetPassConfig *TPC; + TargetPassConfig *TPC = nullptr; MachineDominatorTree MDT; }; } // namespace diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -353,15 +353,15 @@ /// Pair struct containing basic block and taildup profitability struct BlockAndTailDupResult { - MachineBasicBlock *BB; + MachineBasicBlock *BB = nullptr; bool ShouldTailDup; }; /// Triple struct containing edge weight and the edge. struct WeightedEdge { BlockFrequency Weight; - MachineBasicBlock *Src; - MachineBasicBlock *Dest; + MachineBasicBlock *Src = nullptr; + MachineBasicBlock *Dest = nullptr; }; /// work lists of blocks that are ready to be laid out @@ -372,32 +372,32 @@ DenseMap ComputedEdges; /// Machine Function - MachineFunction *F; + MachineFunction *F = nullptr; /// A handle to the branch probability pass. - const MachineBranchProbabilityInfo *MBPI; + const MachineBranchProbabilityInfo *MBPI = nullptr; /// A handle to the function-wide block frequency pass. std::unique_ptr MBFI; /// A handle to the loop info. - MachineLoopInfo *MLI; + MachineLoopInfo *MLI = nullptr; /// Preferred loop exit. /// Member variable for convenience. It may be removed by duplication deep /// in the call stack. - MachineBasicBlock *PreferredLoopExit; + MachineBasicBlock *PreferredLoopExit = nullptr; /// A handle to the target's instruction info. - const TargetInstrInfo *TII; + const TargetInstrInfo *TII = nullptr; /// A handle to the target's lowering info. - const TargetLoweringBase *TLI; + const TargetLoweringBase *TLI = nullptr; /// A handle to the post dominator tree. - MachinePostDominatorTree *MPDT; + MachinePostDominatorTree *MPDT = nullptr; - ProfileSummaryInfo *PSI; + ProfileSummaryInfo *PSI = nullptr; /// Duplicator used to duplicate tails during placement. /// diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp --- a/llvm/lib/CodeGen/MachineCSE.cpp +++ b/llvm/lib/CodeGen/MachineCSE.cpp @@ -68,12 +68,12 @@ namespace { class MachineCSE : public MachineFunctionPass { - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; - AliasAnalysis *AA; - MachineDominatorTree *DT; - MachineRegisterInfo *MRI; - MachineBlockFrequencyInfo *MBFI; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; + AliasAnalysis *AA = nullptr; + MachineDominatorTree *DT = nullptr; + MachineRegisterInfo *MRI = nullptr; + MachineBlockFrequencyInfo *MBFI = nullptr; public: static char ID; // Pass identification diff --git a/llvm/lib/CodeGen/MachineCombiner.cpp b/llvm/lib/CodeGen/MachineCombiner.cpp --- a/llvm/lib/CodeGen/MachineCombiner.cpp +++ b/llvm/lib/CodeGen/MachineCombiner.cpp @@ -63,16 +63,16 @@ namespace { class MachineCombiner : public MachineFunctionPass { - const TargetSubtargetInfo *STI; - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; + const TargetSubtargetInfo *STI = nullptr; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; MCSchedModel SchedModel; - MachineRegisterInfo *MRI; - MachineLoopInfo *MLI; // Current MachineLoopInfo - MachineTraceMetrics *Traces; - MachineTraceMetrics::Ensemble *TraceEnsemble; - MachineBlockFrequencyInfo *MBFI; - ProfileSummaryInfo *PSI; + MachineRegisterInfo *MRI = nullptr; + MachineLoopInfo *MLI = nullptr; // Current MachineLoopInfo + MachineTraceMetrics *Traces = nullptr; + MachineTraceMetrics::Ensemble *TraceEnsemble = nullptr; + MachineBlockFrequencyInfo *MBFI = nullptr; + ProfileSummaryInfo *PSI = nullptr; RegisterClassInfo RegClassInfo; TargetSchedModel TSchedModel; diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp --- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp +++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp @@ -339,9 +339,9 @@ }; class MachineCopyPropagation : public MachineFunctionPass { - const TargetRegisterInfo *TRI; - const TargetInstrInfo *TII; - const MachineRegisterInfo *MRI; + const TargetRegisterInfo *TRI = nullptr; + const TargetInstrInfo *TII = nullptr; + const MachineRegisterInfo *MRI = nullptr; // Return true if this is a copy instruction and false otherwise. bool UseCopyInstr; diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp --- a/llvm/lib/CodeGen/MachineSink.cpp +++ b/llvm/lib/CodeGen/MachineSink.cpp @@ -115,15 +115,15 @@ namespace { class MachineSinking : public MachineFunctionPass { - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; - MachineRegisterInfo *MRI; // Machine register information - MachineDominatorTree *DT; // Machine dominator tree - MachinePostDominatorTree *PDT; // Machine post dominator tree - MachineCycleInfo *CI; - MachineBlockFrequencyInfo *MBFI; - const MachineBranchProbabilityInfo *MBPI; - AliasAnalysis *AA; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; + MachineRegisterInfo *MRI = nullptr; // Machine register information + MachineDominatorTree *DT = nullptr; // Machine dominator tree + MachinePostDominatorTree *PDT = nullptr; // Machine post dominator tree + MachineCycleInfo *CI = nullptr; + MachineBlockFrequencyInfo *MBFI = nullptr; + const MachineBranchProbabilityInfo *MBPI = nullptr; + AliasAnalysis *AA = nullptr; RegisterClassInfo RegClassInfo; // Remember which edges have been considered for breaking. diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -95,12 +95,12 @@ Pass *const PASS; const char *Banner; - const MachineFunction *MF; - const TargetMachine *TM; - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; - const MachineRegisterInfo *MRI; - const RegisterBankInfo *RBI; + const MachineFunction *MF = nullptr; + const TargetMachine *TM = nullptr; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; + const MachineRegisterInfo *MRI = nullptr; + const RegisterBankInfo *RBI = nullptr; unsigned foundErrors; @@ -115,8 +115,8 @@ using RegMap = DenseMap; using BlockSet = SmallPtrSet; - const MachineInstr *FirstNonPHI; - const MachineInstr *FirstTerminator; + const MachineInstr *FirstNonPHI = nullptr; + const MachineInstr *FirstTerminator = nullptr; BlockSet FunctionBlocks; BitVector regsReserved; @@ -208,10 +208,10 @@ } // Analysis information if available - LiveVariables *LiveVars; - LiveIntervals *LiveInts; - LiveStacks *LiveStks; - SlotIndexes *Indexes; + LiveVariables *LiveVars = nullptr; + LiveIntervals *LiveInts = nullptr; + LiveStacks *LiveStks = nullptr; + SlotIndexes *Indexes = nullptr; void visitMachineFunctionBefore(); void visitMachineBasicBlockBefore(const MachineBasicBlock *MBB); diff --git a/llvm/lib/CodeGen/OptimizePHIs.cpp b/llvm/lib/CodeGen/OptimizePHIs.cpp --- a/llvm/lib/CodeGen/OptimizePHIs.cpp +++ b/llvm/lib/CodeGen/OptimizePHIs.cpp @@ -34,8 +34,8 @@ namespace { class OptimizePHIs : public MachineFunctionPass { - MachineRegisterInfo *MRI; - const TargetInstrInfo *TII; + MachineRegisterInfo *MRI = nullptr; + const TargetInstrInfo *TII = nullptr; public: static char ID; // Pass identification diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp --- a/llvm/lib/CodeGen/PHIElimination.cpp +++ b/llvm/lib/CodeGen/PHIElimination.cpp @@ -63,9 +63,9 @@ namespace { class PHIElimination : public MachineFunctionPass { - MachineRegisterInfo *MRI; // Machine register information - LiveVariables *LV; - LiveIntervals *LIS; + MachineRegisterInfo *MRI = nullptr; // Machine register information + LiveVariables *LV = nullptr; + LiveIntervals *LIS = nullptr; public: static char ID; // Pass identification, replacement for typeid diff --git a/llvm/lib/CodeGen/PeepholeOptimizer.cpp b/llvm/lib/CodeGen/PeepholeOptimizer.cpp --- a/llvm/lib/CodeGen/PeepholeOptimizer.cpp +++ b/llvm/lib/CodeGen/PeepholeOptimizer.cpp @@ -150,11 +150,11 @@ class RecurrenceInstr; class PeepholeOptimizer : public MachineFunctionPass { - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; - MachineRegisterInfo *MRI; - MachineDominatorTree *DT; // Machine dominator tree - MachineLoopInfo *MLI; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; + MachineRegisterInfo *MRI = nullptr; + MachineDominatorTree *DT = nullptr; // Machine dominator tree + MachineLoopInfo *MLI = nullptr; public: static char ID; // Pass identification diff --git a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp --- a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp +++ b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp @@ -27,9 +27,9 @@ /// Process IMPLICIT_DEF instructions and make sure there is one implicit_def /// for each use. Add isUndef marker to implicit_def defs and their uses. class ProcessImplicitDefs : public MachineFunctionPass { - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; - MachineRegisterInfo *MRI; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; + MachineRegisterInfo *MRI = nullptr; SmallSetVector WorkList; diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp --- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp +++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp @@ -96,7 +96,7 @@ bool runOnMachineFunction(MachineFunction &MF) override; private: - RegScavenger *RS; + RegScavenger *RS = nullptr; // MinCSFrameIndex, MaxCSFrameIndex - Keeps the range of callee saved // stack frame indexes. diff --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp --- a/llvm/lib/CodeGen/RegAllocFast.cpp +++ b/llvm/lib/CodeGen/RegAllocFast.cpp @@ -75,15 +75,15 @@ } private: - MachineFrameInfo *MFI; - MachineRegisterInfo *MRI; - const TargetRegisterInfo *TRI; - const TargetInstrInfo *TII; + MachineFrameInfo *MFI = nullptr; + MachineRegisterInfo *MRI = nullptr; + const TargetRegisterInfo *TRI = nullptr; + const TargetInstrInfo *TII = nullptr; RegisterClassInfo RegClassInfo; const RegClassFilterFunc ShouldAllocateClass; /// Basic block currently being allocated. - MachineBasicBlock *MBB; + MachineBasicBlock *MBB = nullptr; /// Maps virtual regs to the frame index where these values are spilled. IndexedMap StackSlotForVirtReg; diff --git a/llvm/lib/CodeGen/RegAllocGreedy.h b/llvm/lib/CodeGen/RegAllocGreedy.h --- a/llvm/lib/CodeGen/RegAllocGreedy.h +++ b/llvm/lib/CodeGen/RegAllocGreedy.h @@ -166,20 +166,20 @@ SmallVector, 8>; // context - MachineFunction *MF; + MachineFunction *MF = nullptr; // Shortcuts to some useful interface. - const TargetInstrInfo *TII; + const TargetInstrInfo *TII = nullptr; // analyses - SlotIndexes *Indexes; - MachineBlockFrequencyInfo *MBFI; - MachineDominatorTree *DomTree; - MachineLoopInfo *Loops; - MachineOptimizationRemarkEmitter *ORE; - EdgeBundles *Bundles; - SpillPlacement *SpillPlacer; - LiveDebugVariables *DebugVars; + SlotIndexes *Indexes = nullptr; + MachineBlockFrequencyInfo *MBFI = nullptr; + MachineDominatorTree *DomTree = nullptr; + MachineLoopInfo *Loops = nullptr; + MachineOptimizationRemarkEmitter *ORE = nullptr; + EdgeBundles *Bundles = nullptr; + SpillPlacement *SpillPlacer = nullptr; + LiveDebugVariables *DebugVars = nullptr; // state std::unique_ptr SpillerInstance; diff --git a/llvm/lib/CodeGen/SelectOptimize.cpp b/llvm/lib/CodeGen/SelectOptimize.cpp --- a/llvm/lib/CodeGen/SelectOptimize.cpp +++ b/llvm/lib/CodeGen/SelectOptimize.cpp @@ -98,15 +98,15 @@ class SelectOptimize : public FunctionPass { const TargetMachine *TM = nullptr; - const TargetSubtargetInfo *TSI; + const TargetSubtargetInfo *TSI = nullptr; const TargetLowering *TLI = nullptr; const TargetTransformInfo *TTI = nullptr; - const LoopInfo *LI; - DominatorTree *DT; + const LoopInfo *LI = nullptr; + DominatorTree *DT = nullptr; std::unique_ptr BFI; std::unique_ptr BPI; - ProfileSummaryInfo *PSI; - OptimizationRemarkEmitter *ORE; + ProfileSummaryInfo *PSI = nullptr; + OptimizationRemarkEmitter *ORE = nullptr; TargetSchedModel TSchedModel; public: diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -1744,12 +1744,12 @@ bool SrcOrder; // SUnits - The SUnits for the current graph. - std::vector *SUnits; + std::vector *SUnits = nullptr; MachineFunction &MF; - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; - const TargetLowering *TLI; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; + const TargetLowering *TLI = nullptr; ScheduleDAGRRList *scheduleDAG = nullptr; // SethiUllmanNumbers - The SethiUllman number for each node. diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h @@ -247,7 +247,7 @@ SelectionDAG &DAG; AAResults *AA = nullptr; AssumptionCache *AC = nullptr; - const TargetLibraryInfo *LibInfo; + const TargetLibraryInfo *LibInfo = nullptr; class SDAGSwitchLowering : public SwitchCG::SwitchLowering { public: @@ -261,7 +261,7 @@ } private: - SelectionDAGBuilder *SDB; + SelectionDAGBuilder *SDB = nullptr; }; // Data related to deferred switch lowerings. Used to construct additional @@ -283,7 +283,7 @@ SwiftErrorValueTracking &SwiftError; /// Garbage collection metadata for the function. - GCFunctionInfo *GFI; + GCFunctionInfo *GFI = nullptr; /// Map a landing pad to the call site indexes. DenseMap> LPadToCallSiteMap; @@ -292,7 +292,7 @@ /// a tail call. In this case, no subsequent DAG nodes should be created. bool HasTailCall = false; - LLVMContext *Context; + LLVMContext *Context = nullptr; SelectionDAGBuilder(SelectionDAG &dag, FunctionLoweringInfo &funcinfo, SwiftErrorValueTracking &swifterror, CodeGenOpt::Level ol) diff --git a/llvm/lib/CodeGen/ShrinkWrap.cpp b/llvm/lib/CodeGen/ShrinkWrap.cpp --- a/llvm/lib/CodeGen/ShrinkWrap.cpp +++ b/llvm/lib/CodeGen/ShrinkWrap.cpp @@ -110,26 +110,26 @@ class ShrinkWrap : public MachineFunctionPass { /// Hold callee-saved information. RegisterClassInfo RCI; - MachineDominatorTree *MDT; - MachinePostDominatorTree *MPDT; + MachineDominatorTree *MDT = nullptr; + MachinePostDominatorTree *MPDT = nullptr; /// Current safe point found for the prologue. /// The prologue will be inserted before the first instruction /// in this basic block. - MachineBasicBlock *Save; + MachineBasicBlock *Save = nullptr; /// Current safe point found for the epilogue. /// The epilogue will be inserted before the first terminator instruction /// in this basic block. - MachineBasicBlock *Restore; + MachineBasicBlock *Restore = nullptr; /// Hold the information of the basic block frequency. /// Use to check the profitability of the new points. - MachineBlockFrequencyInfo *MBFI; + MachineBlockFrequencyInfo *MBFI = nullptr; /// Hold the loop information. Used to determine if Save and Restore /// are in the same loop. - MachineLoopInfo *MLI; + MachineLoopInfo *MLI = nullptr; // Emit remarks. MachineOptimizationRemarkEmitter *ORE = nullptr; @@ -147,7 +147,7 @@ Register SP; /// Entry block. - const MachineBasicBlock *Entry; + const MachineBasicBlock *Entry = nullptr; using SetOfRegs = SmallSetVector; @@ -155,7 +155,7 @@ mutable SetOfRegs CurrentCSRs; /// Current MachineFunction. - MachineFunction *MachineFunc; + MachineFunction *MachineFunc = nullptr; /// Check if \p MI uses or defines a callee-saved register or /// a frame index. If this is the case, this means \p MI must happen diff --git a/llvm/lib/CodeGen/SjLjEHPrepare.cpp b/llvm/lib/CodeGen/SjLjEHPrepare.cpp --- a/llvm/lib/CodeGen/SjLjEHPrepare.cpp +++ b/llvm/lib/CodeGen/SjLjEHPrepare.cpp @@ -38,21 +38,21 @@ namespace { class SjLjEHPrepare : public FunctionPass { - IntegerType *DataTy; - Type *doubleUnderDataTy; - Type *doubleUnderJBufTy; - Type *FunctionContextTy; + IntegerType *DataTy = nullptr; + Type *doubleUnderDataTy = nullptr; + Type *doubleUnderJBufTy = nullptr; + Type *FunctionContextTy = nullptr; FunctionCallee RegisterFn; FunctionCallee UnregisterFn; - Function *BuiltinSetupDispatchFn; - Function *FrameAddrFn; - Function *StackAddrFn; - Function *StackRestoreFn; - Function *LSDAAddrFn; - Function *CallSiteFn; - Function *FuncCtxFn; - AllocaInst *FuncCtx; - const TargetMachine *TM; + Function *BuiltinSetupDispatchFn = nullptr; + Function *FrameAddrFn = nullptr; + Function *StackAddrFn = nullptr; + Function *StackRestoreFn = nullptr; + Function *LSDAAddrFn = nullptr; + Function *CallSiteFn = nullptr; + Function *FuncCtxFn = nullptr; + AllocaInst *FuncCtx = nullptr; + const TargetMachine *TM = nullptr; public: static char ID; // Pass identification, replacement for typeid diff --git a/llvm/lib/CodeGen/SpillPlacement.h b/llvm/lib/CodeGen/SpillPlacement.h --- a/llvm/lib/CodeGen/SpillPlacement.h +++ b/llvm/lib/CodeGen/SpillPlacement.h @@ -42,15 +42,15 @@ class SpillPlacement : public MachineFunctionPass { struct Node; - const MachineFunction *MF; - const EdgeBundles *bundles; - const MachineLoopInfo *loops; - const MachineBlockFrequencyInfo *MBFI; + const MachineFunction *MF = nullptr; + const EdgeBundles *bundles = nullptr; + const MachineLoopInfo *loops = nullptr; + const MachineBlockFrequencyInfo *MBFI = nullptr; Node *nodes = nullptr; // Nodes that are active in the current computation. Owned by the prepare() // caller. - BitVector *ActiveNodes; + BitVector *ActiveNodes = nullptr; // Nodes with active links. Populated by scanActiveBundles. SmallVector Linked; diff --git a/llvm/lib/CodeGen/StackColoring.cpp b/llvm/lib/CodeGen/StackColoring.cpp --- a/llvm/lib/CodeGen/StackColoring.cpp +++ b/llvm/lib/CodeGen/StackColoring.cpp @@ -407,8 +407,8 @@ /// StackColoring - A machine pass for merging disjoint stack allocations, /// marked by the LIFETIME_START and LIFETIME_END pseudo instructions. class StackColoring : public MachineFunctionPass { - MachineFrameInfo *MFI; - MachineFunction *MF; + MachineFrameInfo *MFI = nullptr; + MachineFunction *MF = nullptr; /// A class representing liveness information for a single basic block. /// Each bit in the BitVector represents the liveness property @@ -448,7 +448,7 @@ VNInfo::Allocator VNInfoAllocator; /// SlotIndex analysis object. - SlotIndexes *Indexes; + SlotIndexes *Indexes = nullptr; /// The list of lifetime markers found. These markers are to be removed /// once the coloring is done. diff --git a/llvm/lib/CodeGen/StackMapLivenessAnalysis.cpp b/llvm/lib/CodeGen/StackMapLivenessAnalysis.cpp --- a/llvm/lib/CodeGen/StackMapLivenessAnalysis.cpp +++ b/llvm/lib/CodeGen/StackMapLivenessAnalysis.cpp @@ -48,7 +48,7 @@ /// information provided by this pass is optional and not required by the /// aformentioned intrinsic to function. class StackMapLiveness : public MachineFunctionPass { - const TargetRegisterInfo *TRI; + const TargetRegisterInfo *TRI = nullptr; LivePhysRegs LiveRegs; public: diff --git a/llvm/lib/CodeGen/StackSlotColoring.cpp b/llvm/lib/CodeGen/StackSlotColoring.cpp --- a/llvm/lib/CodeGen/StackSlotColoring.cpp +++ b/llvm/lib/CodeGen/StackSlotColoring.cpp @@ -59,10 +59,10 @@ namespace { class StackSlotColoring : public MachineFunctionPass { - LiveStacks* LS; - MachineFrameInfo *MFI; - const TargetInstrInfo *TII; - const MachineBlockFrequencyInfo *MBFI; + LiveStacks *LS = nullptr; + MachineFrameInfo *MFI = nullptr; + const TargetInstrInfo *TII = nullptr; + const MachineBlockFrequencyInfo *MBFI = nullptr; // SSIntervals - Spill slot intervals. std::vector SSIntervals; diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp --- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -87,18 +87,18 @@ namespace { class TwoAddressInstructionPass : public MachineFunctionPass { - MachineFunction *MF; - const TargetInstrInfo *TII; - const TargetRegisterInfo *TRI; - const InstrItineraryData *InstrItins; - MachineRegisterInfo *MRI; - LiveVariables *LV; - LiveIntervals *LIS; - AliasAnalysis *AA; + MachineFunction *MF = nullptr; + const TargetInstrInfo *TII = nullptr; + const TargetRegisterInfo *TRI = nullptr; + const InstrItineraryData *InstrItins = nullptr; + MachineRegisterInfo *MRI = nullptr; + LiveVariables *LV = nullptr; + LiveIntervals *LIS = nullptr; + AliasAnalysis *AA = nullptr; CodeGenOpt::Level OptLevel; // The current basic block being processed. - MachineBasicBlock *MBB; + MachineBasicBlock *MBB = nullptr; // Keep track the distance of a MI from the start of the current basic block. DenseMap DistanceMap; diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp --- a/llvm/lib/CodeGen/VirtRegMap.cpp +++ b/llvm/lib/CodeGen/VirtRegMap.cpp @@ -181,14 +181,14 @@ namespace { class VirtRegRewriter : public MachineFunctionPass { - MachineFunction *MF; - const TargetRegisterInfo *TRI; - const TargetInstrInfo *TII; - MachineRegisterInfo *MRI; - SlotIndexes *Indexes; - LiveIntervals *LIS; - VirtRegMap *VRM; - LiveDebugVariables *DebugVars; + MachineFunction *MF = nullptr; + const TargetRegisterInfo *TRI = nullptr; + const TargetInstrInfo *TII = nullptr; + MachineRegisterInfo *MRI = nullptr; + SlotIndexes *Indexes = nullptr; + LiveIntervals *LIS = nullptr; + VirtRegMap *VRM = nullptr; + LiveDebugVariables *DebugVars = nullptr; DenseSet RewriteRegs; bool ClearVirtRegs;