@@ -1669,8 +1669,8 @@ void AsmPrinter::emitPCSections(const MachineFunction &MF) {
1669
1669
}
1670
1670
1671
1671
// / Returns true if function begin and end labels should be emitted.
1672
- static bool needFuncLabels (const MachineFunction &MF) {
1673
- MachineModuleInfo &MMI = MF. getMMI ();
1672
+ static bool needFuncLabels (const MachineFunction &MF,
1673
+ const MachineModuleInfo &MMI) {
1674
1674
if (!MF.getLandingPads ().empty () || MF.hasEHFunclets () ||
1675
1675
MMI.hasDebugInfo () ||
1676
1676
MF.getFunction ().hasMetadata (LLVMContext::MD_pcsections))
@@ -1944,7 +1944,7 @@ void AsmPrinter::emitFunctionBody() {
1944
1944
// are automatically sized.
1945
1945
bool EmitFunctionSize = MAI->hasDotTypeDotSizeDirective () && !TT.isWasm ();
1946
1946
1947
- if (needFuncLabels (*MF) || EmitFunctionSize) {
1947
+ if (needFuncLabels (*MF, *MMI ) || EmitFunctionSize) {
1948
1948
// Create a symbol for the end of function.
1949
1949
CurrentFnEnd = createTempSymbol (" func_end" );
1950
1950
OutStreamer->emitLabel (CurrentFnEnd);
@@ -2587,8 +2587,9 @@ void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
2587
2587
bool NeedsLocalForSize = MAI->needsLocalForSize ();
2588
2588
if (F.hasFnAttribute (" patchable-function-entry" ) ||
2589
2589
F.hasFnAttribute (" function-instrument" ) ||
2590
- F.hasFnAttribute (" xray-instruction-threshold" ) || needFuncLabels (MF) ||
2591
- NeedsLocalForSize || MF.getTarget ().Options .EmitStackSizeSection ||
2590
+ F.hasFnAttribute (" xray-instruction-threshold" ) ||
2591
+ needFuncLabels (MF, *MMI) || NeedsLocalForSize ||
2592
+ MF.getTarget ().Options .EmitStackSizeSection ||
2592
2593
MF.getTarget ().Options .BBAddrMap || MF.hasBBLabels ()) {
2593
2594
CurrentFnBegin = createTempSymbol (" func_begin" );
2594
2595
if (NeedsLocalForSize)
0 commit comments