diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-18 14:58:34 +0000 | 
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-18 14:58:34 +0000 | 
| commit | 907da171cc911d701da02a5cab898a9c49dd7724 (patch) | |
| tree | 6a111e552c75afc66228e3d8f19b6731e4013f10 /lib/CodeGen/MachineFunction.cpp | |
| parent | 72cc50852bec44580ee7efe1aa2076273008a6ae (diff) | |
Notes
Diffstat (limited to 'lib/CodeGen/MachineFunction.cpp')
| -rw-r--r-- | lib/CodeGen/MachineFunction.cpp | 36 | 
1 files changed, 22 insertions, 14 deletions
| diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 5a1d9e687903..81d1301336b8 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -441,9 +441,10 @@ DebugLocTuple MachineFunction::getDebugLocTuple(DebugLoc DL) const {  /// index with a negative value.  ///  int MachineFrameInfo::CreateFixedObject(uint64_t Size, int64_t SPOffset, -                                        bool Immutable) { +                                        bool Immutable, bool isSS) {    assert(Size != 0 && "Cannot allocate zero size fixed stack objects!"); -  Objects.insert(Objects.begin(), StackObject(Size, 1, SPOffset, Immutable)); +  Objects.insert(Objects.begin(), StackObject(Size, 1, SPOffset, Immutable, +                                              isSS));    return -++NumFixedObjects;  } @@ -529,10 +530,6 @@ void MachineFrameInfo::dump(const MachineFunction &MF) const {  unsigned MachineJumpTableInfo::getJumpTableIndex(                                 const std::vector<MachineBasicBlock*> &DestBBs) {    assert(!DestBBs.empty() && "Cannot create an empty jump table!"); -  for (unsigned i = 0, e = JumpTables.size(); i != e; ++i) -    if (JumpTables[i].MBBs == DestBBs) -      return i; -      JumpTables.push_back(MachineJumpTableEntry(DestBBs));    return JumpTables.size()-1;  } @@ -544,14 +541,25 @@ MachineJumpTableInfo::ReplaceMBBInJumpTables(MachineBasicBlock *Old,                                               MachineBasicBlock *New) {    assert(Old != New && "Not making a change?");    bool MadeChange = false; -  for (size_t i = 0, e = JumpTables.size(); i != e; ++i) { -    MachineJumpTableEntry &JTE = JumpTables[i]; -    for (size_t j = 0, e = JTE.MBBs.size(); j != e; ++j) -      if (JTE.MBBs[j] == Old) { -        JTE.MBBs[j] = New; -        MadeChange = true; -      } -  } +  for (size_t i = 0, e = JumpTables.size(); i != e; ++i) +    ReplaceMBBInJumpTable(i, Old, New); +  return MadeChange; +} + +/// ReplaceMBBInJumpTable - If Old is a target of the jump tables, update +/// the jump table to branch to New instead. +bool +MachineJumpTableInfo::ReplaceMBBInJumpTable(unsigned Idx, +                                            MachineBasicBlock *Old, +                                            MachineBasicBlock *New) { +  assert(Old != New && "Not making a change?"); +  bool MadeChange = false; +  MachineJumpTableEntry &JTE = JumpTables[Idx]; +  for (size_t j = 0, e = JTE.MBBs.size(); j != e; ++j) +    if (JTE.MBBs[j] == Old) { +      JTE.MBBs[j] = New; +      MadeChange = true; +    }    return MadeChange;  } | 
