[all-commits] [llvm/llvm-project] 6487ff: Reland "[yaml2obj][ELF] - Simplify the code that p...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Tue Oct 20 06:26:07 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6487ffafd1dd5ab81c440dde46163218a85d90b5
      https://github.com/llvm/llvm-project/commit/6487ffafd1dd5ab81c440dde46163218a85d90b5
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-10-20 (Tue, 20 Oct 2020)

  Changed paths:
    M clang-tools-extra/clang-tidy/ClangTidyOptions.cpp
    M lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
    M llvm/include/llvm/ObjectYAML/DWARFYAML.h
    M llvm/include/llvm/ObjectYAML/ELFYAML.h
    M llvm/include/llvm/ObjectYAML/MachOYAML.h
    M llvm/include/llvm/ObjectYAML/MinidumpYAML.h
    M llvm/include/llvm/Support/YAMLTraits.h
    M llvm/lib/ObjectYAML/DWARFYAML.cpp
    M llvm/lib/ObjectYAML/ELFYAML.cpp
    M llvm/lib/ObjectYAML/MachOYAML.cpp
    M llvm/lib/ObjectYAML/MinidumpYAML.cpp
    M llvm/test/tools/yaml2obj/ELF/gnu-hash-section.yaml
    M llvm/unittests/Support/YAMLIOTest.cpp

  Log Message:
  -----------
  Reland "[yaml2obj][ELF] - Simplify the code that performs sections validation."

This reverts commit 1b589f4d4db27e3fcd81fdc5abeb9407753ab790 and relands the D89463
with the fix: update `MappingTraits<FileFilter>::validate()` in ClangTidyOptions.cpp to
match the new signature (change the return type to "std::string" from "StringRef").

Original commit message:

This:

Changes the return type of MappingTraits<T>>::validate to std::string
instead of StringRef. It allows to create more complex error messages.

It introduces std::vector<std::pair<StringRef, bool>> getEntries():
a new virtual method of Section, which is the base class for all sections.
It 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.
This approach was discussed in the D89039 thread.

Differential revision: https://reviews.llvm.org/D89463




More information about the All-commits mailing list