19 #include <ModuleDefUtils.h> 23 #include <lib/optional.h> 27 bool inputOrAttrExists(
const std::string& name,
const ModuleDef& def) {
32 auto it = std::find_if(def.inputs.begin(), def.inputs.end(),
33 [&name](
const ArgDef& def) {
34 return def.name == name;
37 exists |= it != def.inputs.end();
42 auto it = std::find_if(def.attributes.begin(), def.attributes.end(),
43 [&name](
const AttrDef& def) {
44 return !def.global && def.name == name;
47 exists |= it != def.attributes.end();
53 gtl::optional<AttrDef> findAttr(
const std::string& name,
const ModuleDef& def) {
54 auto it = std::find_if(def.attributes.begin(), def.attributes.end(),
55 [&name](
const AttrDef& def) {
56 return !def.global && def.name == name;
60 if (it == def.attributes.end())