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

Method codegen

libchigraph/src/LangModule.cpp:32–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 }
31
32 Result codegen(
33 size_t /*execInputID*/, const llvm::DebugLoc& nodeLocation,
34 const std::vector<llvm::Value*>& io, llvm::BasicBlock* codegenInto,
35 const std::vector<llvm::BasicBlock*>& outputBlocks,
36 std::unordered_map<std::string, std::shared_ptr<void>>& /*compileCache*/) override {
37 assert(io.size() == 1 && codegenInto != nullptr && outputBlocks.size() == 2);
38
39 llvm::IRBuilder<> builder(codegenInto);
40 builder.SetCurrentDebugLocation(nodeLocation);
41
42 builder.CreateCondBr(io[0], outputBlocks[0], outputBlocks[1]);
43
44 return {};
45 }
46
47 std::unique_ptr<NodeType> clone() const override { return std::make_unique<IfNodeType>(*this); }
48};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected