diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp --- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp @@ -411,7 +411,7 @@ const TargetLowering &TLI; /// IndexedMap type, mapping from LocIdx to ValueIDNum. - typedef IndexedMap LocToValueType; + using LocToValueType = IndexedMap; /// Map of LocIdxes to the ValueIDNums that they store. This is tightly /// packed, entries only exist for locations that are being tracked. @@ -1302,23 +1302,22 @@ DenseMap>; /// Machine location/value transfer function, a mapping of which locations - // are assigned which new values. - typedef std::map MLocTransferMap; + /// are assigned which new values. + using MLocTransferMap = std::map; /// Live in/out structure for the variable values: a per-block map of /// variables to their values. XXX, better name? - typedef DenseMap *> - LiveIdxT; + using LiveIdxT = + DenseMap *>; - typedef std::pair VarAndLoc; + using VarAndLoc = std::pair; /// Type for a live-in value: the predecessor block, and its value. - typedef std::pair InValueT; + using InValueT = std::pair; /// Vector (per block) of a collection (inner smallvector) of live-ins. /// Used as the result type for the variable value dataflow problem. - typedef SmallVector, 8> LiveInsT; + using LiveInsT = SmallVector, 8>; const TargetRegisterInfo *TRI; const TargetInstrInfo *TII; @@ -1357,7 +1356,7 @@ DenseMap BBNumToRPO; /// Pair of MachineInstr, and its 1-based offset into the containing block. - typedef std::pair InstAndNum; + using InstAndNum = std::pair; /// Map from debug instruction number to the MachineInstr labelled with that /// number, and its location within the function. Used to transform /// instruction numbers in DBG_INSTR_REFs into machine value numbers. @@ -2177,8 +2176,7 @@ // Create a map from the instruction number (if present) to the // MachineInstr and its position. - if (MI.peekDebugInstrNum()) { - uint64_t InstrNo = MI.peekDebugInstrNum(); + if (uint64_t InstrNo = MI.peekDebugInstrNum()) { auto InstrAndPos = std::make_pair(&MI, CurInst); auto InsertResult = DebugInstrNumToInstr.insert(std::make_pair(InstrNo, InstrAndPos)); @@ -2356,7 +2354,7 @@ } } - // Uhhhhhh, reimplement NumInserted and NumRemoved pls. + // TODO: Reimplement NumInserted and NumRemoved. return std::tuple(Changed, DowngradeOccurred); } @@ -2572,7 +2570,7 @@ return std::tuple, bool>(None, false); // Lambda for seeking a common location within a range of location-sets. - typedef SmallVector, 8>::iterator LocsIt; + using LocsIt = SmallVector, 8>::iterator; auto SeekLocation = [&Locs](llvm::iterator_range SearchRange) -> Optional { // Starting with the first set of locations, take the intersection with