From a6d2bdf6050642762cc7bc193bca34690f712d49 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 13 Dec 2016 01:48:40 -0500 Subject: IR: implement breakpoint builtin --- src/codegen.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index b0f7cffff6..f89fb84f69 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2053,6 +2053,11 @@ static LLVMValueRef ir_render_slice(CodeGen *g, IrExecutable *executable, IrInst } } +static LLVMValueRef ir_render_breakpoint(CodeGen *g, IrExecutable *executable, IrInstructionBreakpoint *instruction) { + LLVMBuildCall(g->builder, g->trap_fn_val, nullptr, 0, ""); + return nullptr; +} + static void set_debug_location(CodeGen *g, IrInstruction *instruction) { AstNode *source_node = instruction->source_node; Scope *scope = instruction->scope; @@ -2162,6 +2167,8 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable, return ir_render_memcpy(g, executable, (IrInstructionMemcpy *)instruction); case IrInstructionIdSlice: return ir_render_slice(g, executable, (IrInstructionSlice *)instruction); + case IrInstructionIdBreakpoint: + return ir_render_breakpoint(g, executable, (IrInstructionBreakpoint *)instruction); case IrInstructionIdSwitchVar: case IrInstructionIdContainerInitList: case IrInstructionIdStructInit: -- cgit v1.2.3