[PATCH] D83672: [yaml2obj] - Refine handling of the NoHeaders key.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 01:25:30 PDT 2020


grimar added inline comments.


================
Comment at: llvm/include/llvm/ObjectYAML/ELFYAML.h:97
   Optional<std::vector<SectionHeader>> Excluded;
-  bool NoHeaders;
+  Optional<bool> NoHeaders;
 };
----------------
MaskRay wrote:
> Does `bool NoHeaders = false;` work? If absence is equal to false.
No. This is the same what we implicitly already have:

```
IO.mapOptional("NoHeaders", SectionHeader.NoHeaders, false);
```

When there is no `NoHeaders` or just `NoHeaders = false` in an YAML, and nothing else, then we have an error currently:

```
YAML:11:3: error: SectionHeaderTable can't be empty. Use 'NoHeaders' key to drop the section header table
  NoHeaders: false

```

This is what this patch solves.


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

https://reviews.llvm.org/D83672





More information about the llvm-commits mailing list