summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2024-08-07 14:00:51 -0700
committerFlorian Mayer <fmayer@google.com>2024-08-07 14:00:51 -0700
commit10fbc246b146dbdf6b7cd9083bf392505c534fbc (patch)
tree898a2504a8bc941166603c77021937fd995e79ce /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
parent191d02015fba3458bdf6381ee93c32e485daf25e (diff)
parenta05fa131db58f2d66a1f9e68fea74068f9218c2b (diff)
Created using spr 1.3.4
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 9ca76aa09a2f..8405ba9ac326 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -236,6 +236,7 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
// Create an initial MachineBasicBlock for each LLVM BasicBlock in F. This
// also creates the initial PHI MachineInstrs, though none of the input
// operands are populated.
+ MBBMap.resize(Fn->getMaxBlockNumber());
for (const BasicBlock &BB : *Fn) {
// Don't create MachineBasicBlocks for imaginary EH pad blocks. These blocks
// are really data, and no instructions can live here.
@@ -261,7 +262,7 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
}
MachineBasicBlock *MBB = mf.CreateMachineBasicBlock(&BB);
- MBBMap[&BB] = MBB;
+ MBBMap[BB.getNumber()] = MBB;
MF->push_back(MBB);
// Transfer the address-taken flag. This is necessary because there could