================ @@ -1401,17 +1406,48 @@ void AsmPrinter::emitBBAddrMapSection(const MachineFunction &MF) { uint8_t BBAddrMapVersion = OutStreamer->getContext().getBBAddrMapVersion(); OutStreamer->emitInt8(BBAddrMapVersion); OutStreamer->AddComment("feature"); - auto FeaturesBits = static_cast<uint8_t>(PgoAnalysisMapFeatures.getBits()); - OutStreamer->emitInt8(FeaturesBits); - OutStreamer->AddComment("function address"); - OutStreamer->emitSymbolValue(FunctionSymbol, getPointerSize()); - OutStreamer->AddComment("number of basic blocks"); - OutStreamer->emitULEB128IntValue(MF.size()); - const MCSymbol *PrevMBBEndSymbol = FunctionSymbol; + auto Features = getBBAddrMapFeature(MF, MBBSectionRanges.size()); + OutStreamer->emitInt8(Features.encode()); // Emit BB Information for each basic block in the function. + if (Features.MultiBBRange) { + OutStreamer->AddComment("number of basic block ranges"); + OutStreamer->emitULEB128IntValue(MBBSectionRanges.size()); + } + // Number of blocks in each MBB section. + MapVector<unsigned, unsigned> MBBSectionNumBlocks; + const MCSymbol *PrevMBBEndSymbol = nullptr; + if (!Features.MultiBBRange) { + OutStreamer->AddComment("function address"); ---------------- lifengxiang1025 wrote:
How about doesn't add MultiBBRange as a feature? The default format is starting with `NumBBRanges` even if `NumBBRanges` is one. There are many codes which be added because of MultiBBRange feature. https://github.com/llvm/llvm-project/pull/74128 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits