@@ -1374,7 +1374,7 @@ void AsmPrinter::emitBBAddrMapSection(const MachineFunction &MF) {
1374
1374
OutStreamer->emitULEB128IntValue (MBBSectionRanges.size ());
1375
1375
}
1376
1376
// Number of blocks in each MBB section.
1377
- MapVector<unsigned , unsigned > MBBSectionNumBlocks;
1377
+ MapVector<MBBSectionID , unsigned > MBBSectionNumBlocks;
1378
1378
const MCSymbol *PrevMBBEndSymbol = nullptr ;
1379
1379
if (!Features.MultiBBRange ) {
1380
1380
OutStreamer->AddComment (" function address" );
@@ -1388,7 +1388,7 @@ void AsmPrinter::emitBBAddrMapSection(const MachineFunction &MF) {
1388
1388
BBCount++;
1389
1389
if (MBB.isEndSection ()) {
1390
1390
// Store each section's basic block count when it ends.
1391
- MBBSectionNumBlocks[MBB.getSectionIDNum ()] = BBCount;
1391
+ MBBSectionNumBlocks[MBB.getSectionID ()] = BBCount;
1392
1392
// Reset the count for the next section.
1393
1393
BBCount = 0 ;
1394
1394
}
@@ -1404,8 +1404,7 @@ void AsmPrinter::emitBBAddrMapSection(const MachineFunction &MF) {
1404
1404
OutStreamer->AddComment (" base address" );
1405
1405
OutStreamer->emitSymbolValue (MBBSymbol, getPointerSize ());
1406
1406
OutStreamer->AddComment (" number of basic blocks" );
1407
- OutStreamer->emitULEB128IntValue (
1408
- MBBSectionNumBlocks[MBB.getSectionIDNum ()]);
1407
+ OutStreamer->emitULEB128IntValue (MBBSectionNumBlocks[MBB.getSectionID ()]);
1409
1408
PrevMBBEndSymbol = MBBSymbol;
1410
1409
}
1411
1410
// TODO: Remove this check when version 1 is deprecated.
@@ -1855,7 +1854,9 @@ void AsmPrinter::emitFunctionBody() {
1855
1854
OutContext);
1856
1855
OutStreamer->emitELFSize (CurrentSectionBeginSym, SizeExp);
1857
1856
}
1858
- MBBSectionRanges[MBB.getSectionIDNum ()] =
1857
+ assert (!MBBSectionRanges.contains (MBB.getSectionID ()) &&
1858
+ " Overwrite section range" );
1859
+ MBBSectionRanges[MBB.getSectionID ()] =
1859
1860
MBBSectionRange{CurrentSectionBeginSym, MBB.getEndSymbol ()};
1860
1861
}
1861
1862
}
@@ -1972,7 +1973,9 @@ void AsmPrinter::emitFunctionBody() {
1972
1973
for (auto &Handler : Handlers)
1973
1974
Handler->markFunctionEnd ();
1974
1975
1975
- MBBSectionRanges[MF->front ().getSectionIDNum ()] =
1976
+ assert (!MBBSectionRanges.contains (MF->front ().getSectionID ()) &&
1977
+ " Overwrite section range" );
1978
+ MBBSectionRanges[MF->front ().getSectionID ()] =
1976
1979
MBBSectionRange{CurrentFnBegin, CurrentFnEnd};
1977
1980
1978
1981
// Print out jump tables referenced by the function.
@@ -2536,7 +2539,7 @@ bool AsmPrinter::doFinalization(Module &M) {
2536
2539
}
2537
2540
2538
2541
MCSymbol *AsmPrinter::getMBBExceptionSym (const MachineBasicBlock &MBB) {
2539
- auto Res = MBBSectionExceptionSyms.try_emplace (MBB.getSectionIDNum ());
2542
+ auto Res = MBBSectionExceptionSyms.try_emplace (MBB.getSectionID ());
2540
2543
if (Res.second )
2541
2544
Res.first ->second = createTempSymbol (" exception" );
2542
2545
return Res.first ->second ;
0 commit comments