This allows to use the generic fields validation
mechanism that we have.
The behavior (i.e. an error reported) remains the same.
BBAddrMapSection() : Section(ChunkKind::BBAddrMap) {}
+ std::vector<std::pair<StringRef, bool>> getEntries() const override {
+ return {{"Entries", Entries.hasValue()}};
+ };
+
static bool classof(const Chunk *S) {
return S->Kind == ChunkKind::BBAddrMap;
}
return "";
}
- if (const auto *BBAM = dyn_cast<ELFYAML::BBAddrMapSection>(C.get())) {
- if ((BBAM->Content || BBAM->Size) && BBAM->Entries)
- return "\"Entries\" cannot be used with \"Content\" or \"Size\"";
- return "";
- }
-
return "";
}