================ @@ -1419,32 +1419,50 @@ void ELFState<ELFT>::writeSectionContent( CBA.write(E.Feature); SHeader.sh_size += 2; } - - if (Section.PGOAnalyses) { - if (E.Version < 2) - WithColor::warning() - << "unsupported SHT_LLVM_BB_ADDR_MAP version when using PGO: " - << static_cast<int>(E.Version) << "; must use version >= 2"; + auto FeatureOrErr = llvm::object::BBAddrMap::Features::decode(E.Feature); + bool MultiBBRangeFeatureEnabled = false; + if (!FeatureOrErr) + WithColor::warning() << toString(FeatureOrErr.takeError()); + else + MultiBBRangeFeatureEnabled = FeatureOrErr->MultiBBRange; + bool MultiBBRange = + MultiBBRangeFeatureEnabled || + (E.NumBBRanges.has_value() && E.NumBBRanges.value() > 1) || + (E.BBRanges && E.BBRanges->size() > 1); + if (MultiBBRange && !MultiBBRangeFeatureEnabled) + WithColor::warning() << "Feature value(" << E.Feature ---------------- jh7370 wrote:
```suggestion WithColor::warning() << "feature value(" << E.Feature ``` Nit, per coding standards. 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