summaryrefslogtreecommitdiff
path: root/lib/CodeGen/EdgeBundles.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-06-16 00:03:21 +0000
committerAnna Zaks <ganna@apple.com>2011-06-16 00:03:21 +0000
commit3c397eb741d1b6c5ecf2aa5c3632b7ce3abf55d4 (patch)
treeaf4690c2326cbf98922426afead4ee2ced181053 /lib/CodeGen/EdgeBundles.cpp
parent992205ac71e214562beffd1e84716f0f7ccb3bd9 (diff)
downloadllvm-3c397eb741d1b6c5ecf2aa5c3632b7ce3abf55d4.tar.gz
llvm-3c397eb741d1b6c5ecf2aa5c3632b7ce3abf55d4.tar.bz2
llvm-3c397eb741d1b6c5ecf2aa5c3632b7ce3abf55d4.tar.xz
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
Diffstat (limited to 'lib/CodeGen/EdgeBundles.cpp')
-rw-r--r--lib/CodeGen/EdgeBundles.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/EdgeBundles.cpp b/lib/CodeGen/EdgeBundles.cpp
index 646e01407a..a7aba89b87 100644
--- a/lib/CodeGen/EdgeBundles.cpp
+++ b/lib/CodeGen/EdgeBundles.cpp
@@ -39,7 +39,7 @@ void EdgeBundles::getAnalysisUsage(AnalysisUsage &AU) const {
bool EdgeBundles::runOnMachineFunction(MachineFunction &mf) {
MF = &mf;
EC.clear();
- EC.grow(2 * MF->size());
+ EC.grow(2 * MF->getNumBlockIDs());
for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); I != E;
++I) {