[llvm] [yaml2obj][COFF] Add BBAddrMap support to yaml2coff (PR #224504)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 01:27:18 PDT 2026


================
@@ -193,6 +193,22 @@ static bool writeSectionContent(COFFParser &CP, COFFYAML::Section &S,
   bool HasContent = S.SectionData.binary_size() != 0;
   for (const auto &E : S.StructuredData)
     HasContent |= E.size() != 0;
+  // Every BB address map entry encodes at least a version and a feature field.
+  if (S.BBAddrMapEntries && !S.BBAddrMapEntries->empty())
+    HasContent = true;
+
+  // Warn as ELF BBAddrMap does.
+  const std::vector<BBAddrMapYAML::PGOAnalysisMapEntry> *PGOAnalyses = nullptr;
+  if (S.PGOAnalyses) {
+    if (!S.BBAddrMapEntries)
+      WithColor::warning() << "PGOAnalyses should not exist in "
----------------
jh7370 wrote:

What's the motivation for these being warnings rather hard errors?

https://github.com/llvm/llvm-project/pull/224504


More information about the llvm-commits mailing list