diff options
author | Cameron Zwarich <zwarich@apple.com> | 2013-02-12 03:49:22 +0000 |
---|---|---|
committer | Cameron Zwarich <zwarich@apple.com> | 2013-02-12 03:49:22 +0000 |
commit | 1fc88933e6ffbbb2b876cf67210f1a238f2af16d (patch) | |
tree | 9b50851ab0d1aa4375930237cd7ce5ca69ac808d /include | |
parent | dd58fa4869f9bff909720aaa428487a20fab1391 (diff) | |
download | external_llvm-1fc88933e6ffbbb2b876cf67210f1a238f2af16d.zip external_llvm-1fc88933e6ffbbb2b876cf67210f1a238f2af16d.tar.gz external_llvm-1fc88933e6ffbbb2b876cf67210f1a238f2af16d.tar.bz2 |
Renumber SlotIndexes locally when a new block is inserted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174937 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/SlotIndexes.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h index d4e8c20..76c1cea 100644 --- a/include/llvm/CodeGen/SlotIndexes.h +++ b/include/llvm/CodeGen/SlotIndexes.h @@ -605,14 +605,15 @@ namespace llvm { IndexListEntry *startEntry = 0; IndexListEntry *endEntry = 0; + IndexList::iterator newItr; if (nextMBB == mbb->getParent()->end()) { startEntry = &indexList.back(); endEntry = createEntry(0, 0); - indexList.insertAfter(startEntry, endEntry); + newItr = indexList.insertAfter(startEntry, endEntry); } else { startEntry = createEntry(0, 0); endEntry = getMBBStartIdx(nextMBB).listEntry(); - indexList.insert(endEntry, startEntry); + newItr = indexList.insert(endEntry, startEntry); } SlotIndex startIdx(startEntry, SlotIndex::Slot_Block); @@ -629,9 +630,7 @@ namespace llvm { MBBRanges.push_back(std::make_pair(startIdx, endIdx)); idx2MBBMap.push_back(IdxMBBPair(startIdx, mbb)); - // FIXME: Renumber locally instead of renumbering the whole function every - // time a new block is inserted. - renumberIndexes(); + renumberIndexes(newItr); std::sort(idx2MBBMap.begin(), idx2MBBMap.end(), Idx2MBBCompare()); } |