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

Method codegen

libchigraph/src/LangModule.cpp:117–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115 }
116
117 Result codegen(
118 size_t /*inputExecID*/, const llvm::DebugLoc& nodeLocation,
119 const std::vector<llvm::Value*>& io, llvm::BasicBlock* codegenInto,
120 const std::vector<llvm::BasicBlock*>& outputBlocks,
121 std::unordered_map<std::string, std::shared_ptr<void>>& /*compileCache*/) override {
122 assert(io.size() == 1 && codegenInto != nullptr && outputBlocks.size() == 1);
123
124 llvm::IRBuilder<> builder(codegenInto);
125 builder.SetCurrentDebugLocation(nodeLocation);
126
127 builder.CreateStore(builder.getInt32(number), io[0], false);
128 builder.CreateBr(outputBlocks[0]);
129
130 return {};
131 }
132
133 std::unique_ptr<NodeType> clone() const override {
134 return std::make_unique<ConstIntNodeType>(*this);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected