| ... | ... | @@ -312,6 +312,7 @@ pub const LLVMIRModule = struct { |
| 312 | 312 | .arg => try self.genArg(inst.castTag(.arg).?), |
| 313 | 313 | .alloc => try self.genAlloc(inst.castTag(.alloc).?), |
| 314 | 314 | .store => try self.genStore(inst.castTag(.store).?), |
| 315 | .load => try self.genLoad(inst.castTag(.load).?), |
| 315 | 316 | .dbg_stmt => blk: { |
| 316 | 317 | // TODO: implement debug info |
| 317 | 318 | break :blk null; |
| ... | ... | @@ -396,6 +397,11 @@ pub const LLVMIRModule = struct { |
| 396 | 397 | return null; |
| 397 | 398 | } |
| 398 | 399 | |
| 400 | fn genLoad(self: *LLVMIRModule, inst: *Inst.UnOp) !?*const llvm.ValueRef { |
| 401 | const ptr_val = try self.resolveInst(inst.operand); |
| 402 | return self.builder.buildLoad(ptr_val, ""); |
| 403 | } |
| 404 | |
| 399 | 405 | fn genBreakpoint(self: *LLVMIRModule, inst: *Inst.NoOp) !?*const llvm.ValueRef { |
| 400 | 406 | // TODO: Store this function somewhere such that we dont have to add it again |
| 401 | 407 | const fn_type = llvm.TypeRef.functionType(llvm.voidType(), null, 0, false); |