MCPcopy Create free account
hub / github.com/chigraph/chigraph / codegen

Method codegen

libchigraph/src/LangModule.cpp:149–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 }
148
149 Result codegen(
150 size_t /*inputExecID*/, const llvm::DebugLoc& nodeLocation,
151 const std::vector<llvm::Value*>& io, llvm::BasicBlock* codegenInto,
152 const std::vector<llvm::BasicBlock*>& outputBlocks,
153 std::unordered_map<std::string, std::shared_ptr<void>>& /*compileCache*/) override {
154 assert(io.size() == 1 && codegenInto != nullptr && outputBlocks.size() == 1);
155
156 llvm::IRBuilder<> builder(codegenInto);
157 builder.SetCurrentDebugLocation(nodeLocation);
158
159 builder.CreateStore(llvm::ConstantFP::get(builder.getFloatTy(), number), io[0]);
160 builder.CreateBr(outputBlocks[0]);
161
162 return {};
163 }
164
165 std::unique_ptr<NodeType> clone() const override {
166 return std::make_unique<ConstFloatNodeType>(*this);

Callers

nothing calls this directly

Calls 1

getFunction · 0.85

Tested by

no test coverage detected