| 71 | } |
| 72 | |
| 73 | Optional<String> GetFunctionDoc(const String& name) final { |
| 74 | // Look for __tvm_ffi__doc_<name> symbol |
| 75 | String doc_symbol = symbol::tvm_ffi_doc_prefix + name; |
| 76 | void* symbol = lib_->GetSymbol(doc_symbol); |
| 77 | if (symbol != nullptr) { |
| 78 | using DocGetter = int (*)(void*, const TVMFFIAny*, int32_t, TVMFFIAny*); |
| 79 | auto doc_getter = reinterpret_cast<DocGetter>(symbol); |
| 80 | return Function::InvokeExternC(nullptr, doc_getter).cast<String>(); |
| 81 | } |
| 82 | return std::nullopt; |
| 83 | } |
| 84 | |
| 85 | private: |
| 86 | ObjectPtr<Library> lib_; |