Function::getNumBlockIDs() should be used instead of Function::size() to set the...
authorAnna Zaks <ganna@apple.com>
Thu, 16 Jun 2011 00:03:21 +0000 (00:03 +0000)
committerAnna Zaks <ganna@apple.com>
Thu, 16 Jun 2011 00:03:21 +0000 (00:03 +0000)
commit3c397eb741d1b6c5ecf2aa5c3632b7ce3abf55d4
treeaf4690c2326cbf98922426afead4ee2ced181053
parent992205ac71e214562beffd1e84716f0f7ccb3bd9
Function::getNumBlockIDs() should be used instead of Function::size() to set the upper limit on the block IDs since basic blocks might get removed (simplified away) after being initially numbered. Plus the test case, in which SelectionDAGBuilder::visitBr() calls llvm::MachineFunction::removeFromMBBNumbering(), which introduces the hole in numbering leading to an assert in llc (prior to the fix).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133113 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/EdgeBundles.cpp
test/CodeGen/Generic/edge-bundles-blockIDs.c [new file with mode: 0644]