[PATCH] D96831: [obj2yaml,yaml2obj] Add NumBlocks to the BBAddrMapEntry yaml field.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 00:47:41 PST 2021


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

LGTM, with nits.



================
Comment at: llvm/lib/ObjectYAML/ELFEmitter.cpp:1362
+    // Write number of BBEntries (number of basic blocks in the function). This
+    // is overriden by the 'NumBlocks' YAML field if specified.
+    uint32_t NumBlocks =
----------------



================
Comment at: llvm/test/tools/obj2yaml/ELF/bb-addr-map.yaml:133
+## Check that obj2yaml uses the "Content" tag to describe an .llvm_bb_addr_map section
+## when it can't extract the entries, for example, when section is truncated, or when
+## an invalid NumBlocks field is specified.
----------------



================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:864
     }
-    Entries.push_back({Address, BBEntries});
+    Entries.push_back({Address, /* NumBlocks */ {}, BBEntries});
   }
----------------
clang-format seems to recognise this comment styling, and it seems clearer to me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96831/new/

https://reviews.llvm.org/D96831



More information about the llvm-commits mailing list