Helper to instantiate function "func" in the library "lib".
| 37 | |
| 38 | // Helper to instantiate function "func" in the library "lib". |
| 39 | Status Instantiate(FunctionLibraryRuntime* lib, const NameAttrList& func, |
| 40 | FunctionLibraryRuntime::Handle* handle) { |
| 41 | return lib->Instantiate(func.name(), AttrSlice(&func.attr()), handle); |
| 42 | } |
| 43 | |
| 44 | template <typename To, typename From> // use like this: down_cast<T*>(foo); |
| 45 | inline To down_cast(From* f) { // so we only accept pointers |