[PATCH] D88717: [obj2yaml] [yaml2obj] Add yaml support for SHT_LLVM_BB_ADDR_MAP section.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 19 02:13:32 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/lib/ObjectYAML/ELFYAML.cpp:1672
+  IO.mapRequired("NumBlocks", E.NumBlocks);
+  IO.mapOptional("BBEntries", E.BBEntries);
+}
----------------
grimar wrote:
> I think you don't need `NumBlock` YAML key. It matches the number of items in "BBEntries", right?
> E.g. see how we describe `Notes` (and other things):
> 
> ```
>   - Name:  .note.foo
>     Type:  SHT_NOTE
>     Flags: [ SHF_ALLOC ]
>     Notes:
>       - Name: AB
>         Desc: ''
>         Type: 0xFF
>       - Name: ABC
>         Desc: '123456'
>         Type: 254
> ```
Presumably if the NumBlock field corresponds to part of the data structure, we want it to be an Optional member, so that users can override it independently of the number of entries - that way tests can be crafted that show what happens if the value is invalid.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88717



More information about the llvm-commits mailing list