[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
Wed Oct 28 02:18:30 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/obj2yaml/ELF/bb-addr-map.yaml:128
+## Check that Address is not emitted when it's zero.
+# MULTI-NOT:          Address
+# MULTI-NEXT:       - BBEntries:
----------------
Same as above - the `-NOT` check is unnecessary due to the use of the `-NEXT` pattern throughout.


================
Comment at: llvm/test/tools/yaml2obj/ELF/bb-addr-map.yaml:7
+## 2) We can produce an empty .llvm_bb_addr_map section from a description
+##    swith empty section content.
+## 3) We can produce a zero .llvm_bb_addr_map section of a specific size when
----------------



================
Comment at: llvm/test/tools/yaml2obj/ELF/bb-addr-map.yaml:40
+# CHECK:        Size:
+# CHECK-SAME:   0
+
----------------
Watch out - this will also match `Size: 10`. You need extra regex patterns to make sure there are no preceding characters, e.g:
```
# CHECK:      Size:{{ }}
# CHECK-SAME: {{^}}0
```
(in this context the `^` character represents the end of the previous match).


================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:800
+
+  if (Content.empty() || !Cur) {
+    // If the section cannot be decoded, we dump it as an array of bytes.
----------------
In the `empty()` case, I think it would be great to not specify `Content` or `Entries`, so that you end up with a section like this:
```
Name: .llvm_bb_addr_map
Type: SHT_LLVM_BB_ADDR_MAP
```


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