diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/LiveDebugVariables.cpp | 16 | 
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index b72355d55a2..4e34f8534b1 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp @@ -166,6 +166,8 @@ public:             indirect == IsIndirect;    } +  enum : unsigned { UndefLocNo = ~0U }; +    /// merge - Merge equivalence classes.    static UserValue *merge(UserValue *L1, UserValue *L2) {      L2 = L2->getLeader(); @@ -190,7 +192,7 @@ public:    unsigned getLocationNo(const MachineOperand &LocMO) {      if (LocMO.isReg()) {        if (LocMO.getReg() == 0) -        return ~0u; +        return UndefLocNo;        // For register locations we dont care about use/def and other flags.        for (unsigned i = 0, e = locations.size(); i != e; ++i)          if (locations[i].isReg() && @@ -403,7 +405,7 @@ void UserValue::print(raw_ostream &OS, const TargetRegisterInfo *TRI) {    OS << "\"\t";    for (LocMap::const_iterator I = locInts.begin(); I.valid(); ++I) {      OS << " [" << I.start() << ';' << I.stop() << "):"; -    if (I.value() == ~0u) +    if (I.value() == UndefLocNo)        OS << "undef";      else        OS << I.value(); @@ -664,7 +666,7 @@ void UserValue::computeIntervals(MachineRegisterInfo &MRI,    // Collect all defs to be extended (Skipping undefs).    for (LocMap::const_iterator I = locInts.begin(); I.valid(); ++I) -    if (I.value() != ~0u) +    if (I.value() != UndefLocNo)        Defs.push_back(std::make_pair(I.start(), I.value()));    // Extend all defs, and possibly add new ones along the way. @@ -703,7 +705,7 @@ void UserValue::computeIntervals(MachineRegisterInfo &MRI,    // Erase all the undefs.    for (LocMap::iterator I = locInts.begin(); I.valid();) -    if (I.value() == ~0u) +    if (I.value() == UndefLocNo)        I.erase();      else        ++I; @@ -856,7 +858,7 @@ UserValue::splitLocation(unsigned OldLocNo, ArrayRef<unsigned> NewRegs,        continue;      // Don't allocate the new LocNo until it is needed. -    unsigned NewLocNo = ~0u; +    unsigned NewLocNo = UndefLocNo;      // Iterate over the overlaps between locInts and LI.      LocMapI.find(LI->beginIndex()); @@ -873,7 +875,7 @@ UserValue::splitLocation(unsigned OldLocNo, ArrayRef<unsigned> NewRegs,        // Now LII->end > LocMapI.start(). Do we have an overlap?        if (LocMapI.value() == OldLocNo && LII->start < LocMapI.stop()) {          // Overlapping correct location. Allocate NewLocNo now. -        if (NewLocNo == ~0u) { +        if (NewLocNo == UndefLocNo) {            MachineOperand MO = MachineOperand::CreateReg(LI->reg, false);            MO.setSubReg(locations[OldLocNo].getSubReg());            NewLocNo = getLocationNo(MO); @@ -1069,7 +1071,7 @@ void UserValue::emitDebugValues(VirtRegMap *VRM, LiveIntervals &LIS,      SlotIndex Start = I.start();      SlotIndex Stop = I.stop();      unsigned LocNo = I.value(); -    bool Spilled = LocNo != ~0U ? SpilledLocations.test(LocNo) : false; +    bool Spilled = LocNo != UndefLocNo ? SpilledLocations.test(LocNo) : false;      // If the interval start was trimmed to the lexical scope insert the      // DBG_VALUE at the previous index (otherwise it appears after the  | 

