| 4 | // add extern func |
| 5 | |
| 6 | void addExternFunc(Module& mod, const FunctionPtr & fnX, bool isCmres, SideEffects seFlags) { |
| 7 | if (!isCmres) { |
| 8 | if (fnX->result->isRefType() && !fnX->result->ref) { |
| 9 | DAS_FATAL_ERROR( |
| 10 | "addExtern(%s)::failed in module %s\n" |
| 11 | " this function should be bound with addExtern<DAS_BIND_FUNC(%s), SimNode_ExtFuncCallAndCopyOrMove>\n" |
| 12 | " likely cast<> is implemented for the return type, and it should not\n", |
| 13 | fnX->name.c_str(), mod.name.c_str(), fnX->name.c_str()); |
| 14 | } |
| 15 | } |
| 16 | fnX->setSideEffects(seFlags); |
| 17 | if (!mod.addFunction(fnX)) { |
| 18 | DAS_FATAL_ERROR("addExtern(%s) failed in module %s\n", fnX->name.c_str(), mod.name.c_str()); |
| 19 | } |
| 20 | } |
| 21 | } |
no test coverage detected