Compare commits
2 Commits
21a862b2bf
...
6e36338eba
Author | SHA1 | Date | |
---|---|---|---|
6e36338eba | |||
a0b2218cc3 |
@ -888,6 +888,7 @@ LLVMIntrinsicIndex = enum u32
|
|||||||
{
|
{
|
||||||
"llvm.ctlz",
|
"llvm.ctlz",
|
||||||
"llvm.cttz",
|
"llvm.cttz",
|
||||||
|
"llvm.debugtrap",
|
||||||
"llvm.smax",
|
"llvm.smax",
|
||||||
"llvm.smin",
|
"llvm.smin",
|
||||||
"llvm.trap",
|
"llvm.trap",
|
||||||
@ -2032,6 +2033,7 @@ ValueId = enum
|
|||||||
macro_instantiation,
|
macro_instantiation,
|
||||||
field_parent_pointer,
|
field_parent_pointer,
|
||||||
build_mode,
|
build_mode,
|
||||||
|
breakpoint,
|
||||||
}
|
}
|
||||||
|
|
||||||
ValueConstantInteger = struct
|
ValueConstantInteger = struct
|
||||||
@ -4126,6 +4128,7 @@ ValueKeyword = enum
|
|||||||
ValueIntrinsic = enum
|
ValueIntrinsic = enum
|
||||||
{
|
{
|
||||||
align_of,
|
align_of,
|
||||||
|
breakpoint,
|
||||||
build_mode,
|
build_mode,
|
||||||
byte_size,
|
byte_size,
|
||||||
enum_from_int,
|
enum_from_int,
|
||||||
@ -5769,6 +5772,7 @@ parse_left = fn (module: &Module, scope: &Scope, builder: ValueBuilder) &Value
|
|||||||
.trap,
|
.trap,
|
||||||
.va_start,
|
.va_start,
|
||||||
.has_debug_info,
|
.has_debug_info,
|
||||||
|
.breakpoint,
|
||||||
=>
|
=>
|
||||||
{
|
{
|
||||||
skip_space(module);
|
skip_space(module);
|
||||||
@ -5782,6 +5786,7 @@ parse_left = fn (module: &Module, scope: &Scope, builder: ValueBuilder) &Value
|
|||||||
.trap => { id = .trap; },
|
.trap => { id = .trap; },
|
||||||
.va_start => { id = .va_start; },
|
.va_start => { id = .va_start; },
|
||||||
.has_debug_info => { id = .has_debug_info; },
|
.has_debug_info => { id = .has_debug_info; },
|
||||||
|
.breakpoint => { id = .breakpoint; },
|
||||||
else => { unreachable; },
|
else => { unreachable; },
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12432,6 +12437,15 @@ analyze_type = fn (module: &Module, value: &Value, expected_type: &Type, analysi
|
|||||||
value_type = uint1(module);
|
value_type = uint1(module);
|
||||||
typecheck(module, expected_type, value_type);
|
typecheck(module, expected_type, value_type);
|
||||||
},
|
},
|
||||||
|
.breakpoint =>
|
||||||
|
{
|
||||||
|
if (expected_type)
|
||||||
|
{
|
||||||
|
report_error();
|
||||||
|
}
|
||||||
|
|
||||||
|
value_type = void_type(module);
|
||||||
|
},
|
||||||
else =>
|
else =>
|
||||||
{
|
{
|
||||||
@trap();
|
@trap();
|
||||||
@ -15601,6 +15615,11 @@ emit_value = fn (module: &Module, value: &Value, type_kind: TypeKind, expect_con
|
|||||||
{
|
{
|
||||||
llvm_value = LLVMConstInt(get_llvm_type(resolved_value_type, type_kind), @extend(module.has_debug_info), 0);
|
llvm_value = LLVMConstInt(get_llvm_type(resolved_value_type, type_kind), @extend(module.has_debug_info), 0);
|
||||||
},
|
},
|
||||||
|
.breakpoint =>
|
||||||
|
{
|
||||||
|
>call = emit_intrinsic_call(module, ."llvm.debugtrap", zero, zero);
|
||||||
|
llvm_value = call;
|
||||||
|
},
|
||||||
else =>
|
else =>
|
||||||
{
|
{
|
||||||
@trap();
|
@trap();
|
||||||
|
@ -2061,6 +2061,15 @@ pointer_sub = fn () void
|
|||||||
require(sub == 1);
|
require(sub == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
breakpoint = fn () void
|
||||||
|
{
|
||||||
|
>ok: u1 = 1;
|
||||||
|
if (!ok)
|
||||||
|
{
|
||||||
|
@breakpoint();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CPUArchitecture = enum
|
CPUArchitecture = enum
|
||||||
{
|
{
|
||||||
x86_64,
|
x86_64,
|
||||||
@ -2119,7 +2128,6 @@ struct_arbitrary_int_abi = fn () void
|
|||||||
require(some_struct.e == 123);
|
require(some_struct.e == 123);
|
||||||
require(some_struct.f == 45);
|
require(some_struct.f == 45);
|
||||||
require(some_struct.g == 46);
|
require(some_struct.g == 46);
|
||||||
}
|
|
||||||
|
|
||||||
[export] main = fn [cc(c)] (argc: s32, argv: &&u8, envp: &&u8) s32
|
[export] main = fn [cc(c)] (argc: s32, argv: &&u8, envp: &&u8) s32
|
||||||
{
|
{
|
||||||
@ -2384,6 +2392,8 @@ struct_arbitrary_int_abi = fn () void
|
|||||||
|
|
||||||
pointer_sub();
|
pointer_sub();
|
||||||
|
|
||||||
|
breakpoint();
|
||||||
|
|
||||||
struct_arbitrary_int_abi();
|
struct_arbitrary_int_abi();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user