diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:44:32 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:44:32 +0000 | 
| commit | 5a5ac124e1efaf208671f01c46edb15f29ed2a0b (patch) | |
| tree | a6140557876943cdd800ee997c9317283394b22c /lib/CodeGen/MachineBasicBlock.cpp | |
| parent | f03b5bed27d0d2eafd68562ce14f8b5e3f1f0801 (diff) | |
Notes
Diffstat (limited to 'lib/CodeGen/MachineBasicBlock.cpp')
| -rw-r--r-- | lib/CodeGen/MachineBasicBlock.cpp | 36 | 
1 files changed, 17 insertions, 19 deletions
| diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 3c7390527e5f..d5fdf8ed7a0c 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -53,7 +53,7 @@ MCSymbol *MachineBasicBlock::getSymbol() const {      const MachineFunction *MF = getParent();      MCContext &Ctx = MF->getContext();      const char *Prefix = Ctx.getAsmInfo()->getPrivateLabelPrefix(); -    CachedMCSymbol = Ctx.GetOrCreateSymbol(Twine(Prefix) + "BB" + +    CachedMCSymbol = Ctx.getOrCreateSymbol(Twine(Prefix) + "BB" +                                             Twine(MF->getFunctionNumber()) +                                             "_" + Twine(getNumber()));    } @@ -250,7 +250,7 @@ std::string MachineBasicBlock::getFullName() const {    if (getBasicBlock())      Name += getBasicBlock()->getName();    else -    Name += (Twine("BB") + Twine(getNumber())).str(); +    Name += ("BB" + Twine(getNumber())).str();    return Name;  } @@ -307,7 +307,7 @@ void MachineBasicBlock::print(raw_ostream &OS, SlotIndexes *Indexes) const {      OS << '\t';      if (I->isInsideBundle())        OS << "  * "; -    I->print(OS, &getParent()->getTarget()); +    I->print(OS);    }    // Print the successors of this block according to the CFG. @@ -1129,21 +1129,19 @@ getWeightIterator(MachineBasicBlock::const_succ_iterator I) const {  /// instructions after (searching just for defs) MI.  MachineBasicBlock::LivenessQueryResult  MachineBasicBlock::computeRegisterLiveness(const TargetRegisterInfo *TRI, -                                           unsigned Reg, MachineInstr *MI, -                                           unsigned Neighborhood) { +                                           unsigned Reg, const_iterator Before, +                                           unsigned Neighborhood) const {    unsigned N = Neighborhood; -  MachineBasicBlock *MBB = MI->getParent(); -  // Start by searching backwards from MI, looking for kills, reads or defs. - -  MachineBasicBlock::iterator I(MI); +  // Start by searching backwards from Before, looking for kills, reads or defs. +  const_iterator I(Before);    // If this is the first insn in the block, don't search backwards. -  if (I != MBB->begin()) { +  if (I != begin()) {      do {        --I;        MachineOperandIteratorBase::PhysRegInfo Analysis = -        MIOperands(I).analyzePhysReg(Reg, TRI); +        ConstMIOperands(I).analyzePhysReg(Reg, TRI);        if (Analysis.Defines)          // Outputs happen after inputs so they take precedence if both are @@ -1158,15 +1156,15 @@ MachineBasicBlock::computeRegisterLiveness(const TargetRegisterInfo *TRI,          // Defined or read without a previous kill - live.          return Analysis.Reads ? LQR_Live : LQR_OverlappingLive; -    } while (I != MBB->begin() && --N > 0); +    } while (I != begin() && --N > 0);    }    // Did we get to the start of the block? -  if (I == MBB->begin()) { +  if (I == begin()) {      // If so, the register's state is definitely defined by the live-in state.      for (MCRegAliasIterator RAI(Reg, TRI, /*IncludeSelf=*/true);           RAI.isValid(); ++RAI) { -      if (MBB->isLiveIn(*RAI)) +      if (isLiveIn(*RAI))          return (*RAI == Reg) ? LQR_Live : LQR_OverlappingLive;      } @@ -1175,13 +1173,13 @@ MachineBasicBlock::computeRegisterLiveness(const TargetRegisterInfo *TRI,    N = Neighborhood; -  // Try searching forwards from MI, looking for reads or defs. -  I = MachineBasicBlock::iterator(MI); +  // Try searching forwards from Before, looking for reads or defs. +  I = const_iterator(Before);    // If this is the last insn in the block, don't search forwards. -  if (I != MBB->end()) { -    for (++I; I != MBB->end() && N > 0; ++I, --N) { +  if (I != end()) { +    for (++I; I != end() && N > 0; ++I, --N) {        MachineOperandIteratorBase::PhysRegInfo Analysis = -        MIOperands(I).analyzePhysReg(Reg, TRI); +        ConstMIOperands(I).analyzePhysReg(Reg, TRI);        if (Analysis.ReadsOverlap)          // Used, therefore must have been live. | 
