aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-12-13 01:48:40 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-12-13 01:48:40 -0500
commita6d2bdf6050642762cc7bc193bca34690f712d49 (patch)
tree10db99199b91f09b0eb908013f96e35a6a5eceae /src/codegen.cpp
parent76a849b1f2c1bb57de4baf8dfd49fe9f9e2340f3 (diff)
downloadzig-a6d2bdf6050642762cc7bc193bca34690f712d49.tar.gz
zig-a6d2bdf6050642762cc7bc193bca34690f712d49.zip
IR: implement breakpoint builtin
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp7
1 files changed, 7 insertions, 0 deletions
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: