diff options
Diffstat (limited to 'llvm/lib/CodeGen/LiveRangeCalc.h')
-rw-r--r-- | llvm/lib/CodeGen/LiveRangeCalc.h | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeCalc.h b/llvm/lib/CodeGen/LiveRangeCalc.h index d41b782d9bd..c4914f23f56 100644 --- a/llvm/lib/CodeGen/LiveRangeCalc.h +++ b/llvm/lib/CodeGen/LiveRangeCalc.h @@ -1,4 +1,4 @@ -//===---- LiveRangeCalc.h - Calculate live ranges ---------------*- C++ -*-===// +//===- LiveRangeCalc.h - Calculate live ranges ------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -26,28 +26,35 @@ #include "llvm/ADT/BitVector.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/IndexedMap.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/LiveInterval.h" +#include "llvm/CodeGen/MachineBasicBlock.h" +#include "llvm/CodeGen/SlotIndexes.h" +#include "llvm/MC/LaneBitmask.h" +#include <utility> namespace llvm { -/// Forward declarations for MachineDominators.h: -class MachineDominatorTree; template <class NodeT> class DomTreeNodeBase; -typedef DomTreeNodeBase<MachineBasicBlock> MachineDomTreeNode; +class MachineDominatorTree; +class MachineFunction; +class MachineRegisterInfo; + +using MachineDomTreeNode = DomTreeNodeBase<MachineBasicBlock>; class LiveRangeCalc { - const MachineFunction *MF; - const MachineRegisterInfo *MRI; - SlotIndexes *Indexes; - MachineDominatorTree *DomTree; - VNInfo::Allocator *Alloc; + const MachineFunction *MF = nullptr; + const MachineRegisterInfo *MRI = nullptr; + SlotIndexes *Indexes = nullptr; + MachineDominatorTree *DomTree = nullptr; + VNInfo::Allocator *Alloc = nullptr; /// LiveOutPair - A value and the block that defined it. The domtree node is /// redundant, it can be computed as: MDT[Indexes.getMBBFromIndex(VNI->def)]. - typedef std::pair<VNInfo*, MachineDomTreeNode*> LiveOutPair; + using LiveOutPair = std::pair<VNInfo *, MachineDomTreeNode *>; /// LiveOutMap - Map basic blocks to the value leaving the block. - typedef IndexedMap<LiveOutPair, MBB2NumberFunctor> LiveOutMap; + using LiveOutMap = IndexedMap<LiveOutPair, MBB2NumberFunctor>; /// Bit vector of active entries in LiveOut, also used as a visited set by /// findReachingDefs. One entry per basic block, indexed by block number. @@ -66,7 +73,7 @@ class LiveRangeCalc { /// registers do not overlap), but the defined/undefined information must /// be kept separate for each individual range. /// By convention, EntryInfoMap[&LR] = { Defined, Undefined }. - typedef DenseMap<LiveRange*,std::pair<BitVector,BitVector>> EntryInfoMap; + using EntryInfoMap = DenseMap<LiveRange *, std::pair<BitVector, BitVector>>; EntryInfoMap EntryInfos; /// Map each basic block where a live range is live out to the live-out value @@ -105,10 +112,10 @@ class LiveRangeCalc { SlotIndex Kill; // Live-in value filled in by updateSSA once it is known. - VNInfo *Value; + VNInfo *Value = nullptr; LiveInBlock(LiveRange &LR, MachineDomTreeNode *node, SlotIndex kill) - : LR(LR), DomNode(node), Kill(kill), Value(nullptr) {} + : LR(LR), DomNode(node), Kill(kill) {} }; /// LiveIn - Work list of blocks where the live-in value has yet to be @@ -171,8 +178,7 @@ class LiveRangeCalc { void resetLiveOutMap(); public: - LiveRangeCalc() : MF(nullptr), MRI(nullptr), Indexes(nullptr), - DomTree(nullptr), Alloc(nullptr) {} + LiveRangeCalc() = default; //===--------------------------------------------------------------------===// // High-level interface. @@ -186,10 +192,8 @@ public: /// that may overlap a previously computed live range, and before the first /// live range in a function. If live ranges are not known to be /// non-overlapping, call reset before each. - void reset(const MachineFunction *MF, - SlotIndexes*, - MachineDominatorTree*, - VNInfo::Allocator*); + void reset(const MachineFunction *mf, SlotIndexes *SI, + MachineDominatorTree *MDT, VNInfo::Allocator *VNIA); //===--------------------------------------------------------------------===// // Mid-level interface. @@ -282,4 +286,4 @@ public: } // end namespace llvm -#endif +#endif // LLVM_LIB_CODEGEN_LIVERANGECALC_H |