| 175 | /// The NodeType for calling C functions |
| 176 | struct CFuncNode : NodeType { |
| 177 | CFuncNode(GraphModule& mod, std::string cCode, std::string functionName, |
| 178 | std::vector<std::string> extraArgs, std::vector<NamedDataType> inputs, |
| 179 | DataType output) |
| 180 | : NodeType{mod, "c-call", "call C code"}, |
| 181 | mFunctionName{std::move(functionName)}, |
| 182 | mCCode(std::move(cCode)), |
| 183 | mExtraArguments{std::move(extraArgs)}, |
| 184 | mInputs{std::move(inputs)}, |
| 185 | mOutput{std::move(output)}, |
| 186 | mGraphModule{&mod} { |
| 187 | setExecInputs({""}); |
| 188 | setExecOutputs({""}); |
| 189 | |
| 190 | setDataInputs(mInputs); |
| 191 | if (mOutput.valid()) { setDataOutputs({{"", mOutput}}); } |
| 192 | } |
| 193 | |
| 194 | Result codegen( |
| 195 | size_t /*inID*/, const llvm::DebugLoc& nodeLocation, const std::vector<llvm::Value*>& io, |