[PATCH] D89463: [yaml2obj][ELF] - Simplify the code that performs sections validation.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 15 23:34:32 PDT 2020


grimar added a comment.

In D89463#2333696 <https://reviews.llvm.org/D89463#2333696>, @MaskRay wrote:

>> Implements one of approaches discussed in the D89039 <https://reviews.llvm.org/D89039> thread, which allows to generalize sections validation.
>
> Probably just copy some messages from https://reviews.llvm.org/D89039#inline-828862 to make the description self-contained

Will do.

> In short, this moves a bunch of checks from MappingTraits<std::unique_ptr<ELFYAML::Chunk>>::validate to `*::getEntries`

I'd say that checks are not moved. `*::getEntries` is a new virtual method of `Section`, which is the base class for all sections.
It just returns names of special section specific keys (e.g. "Entries") and flags that says if them exist in a YAML.
The code in `validate()` uses this list of entries descriptions to generalize validation. The validation and error reporting is still performed in `validate()`.


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

https://reviews.llvm.org/D89463



More information about the llvm-commits mailing list