Returns the associated option name for the given op definition.
| 59 | |
| 60 | // Returns the associated option name for the given op definition. |
| 61 | static inline std::string GetOperatorOptionName(const Record &def) { |
| 62 | assert(def.getName().startswith("TFL_") && "unexpected op prefix"); |
| 63 | assert(def.getName().endswith("Op") && "unexpected op suffix"); |
| 64 | |
| 65 | auto *custom_option = dyn_cast<StringInit>(def.getValueInit("customOption")); |
| 66 | std::ostringstream oss; |
| 67 | if (custom_option) |
| 68 | oss << custom_option->getValue().str(); |
| 69 | else |
| 70 | oss << def.getName().drop_front(4).drop_back(2).str() << "Options"; |
| 71 | return oss.str(); |
| 72 | } |
| 73 | |
| 74 | // Returns the builder function name for the given op definition. |
| 75 | static inline std::string GetOperatorBuilderName(StringRef op_name) { |
no test coverage detected