mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Update Windows debug output.
This commit is contained in:
@@ -24,6 +24,7 @@ static LLVMMetadataRef llvm_debug_enum_type(GenContext *c, Type *type, LLVMMetad
|
||||
|
||||
INLINE LLVMMetadataRef llvm_create_debug_location_with_inline(GenContext *c, unsigned row, unsigned col, LLVMMetadataRef scope)
|
||||
{
|
||||
if (!c->debug.emit_expr_loc) col = 0;
|
||||
return LLVMDIBuilderCreateDebugLocation(c->context, row, col,
|
||||
scope, c->debug.block_stack->inline_loc ? c->debug.block_stack->inline_loc : NULL);
|
||||
}
|
||||
@@ -223,6 +224,7 @@ void llvm_emit_debug_location(GenContext *c, SourceSpan location)
|
||||
LLVMMetadataRef oldloc = LLVMGetCurrentDebugLocation2(c->builder);
|
||||
if (oldloc && c->last_emitted_loc.a == location.a) return;
|
||||
LLVMMetadataRef loc = c->last_loc = llvm_create_debug_location(c, location);
|
||||
if (!c->debug.emit_expr_loc) location.col = 0;
|
||||
c->last_emitted_loc.a = location.a;
|
||||
LLVMSetCurrentDebugLocation2(c->builder, loc);
|
||||
|
||||
|
||||
@@ -576,7 +576,7 @@ void llvm_emit_debug_local_var(GenContext *c, Decl *var);
|
||||
|
||||
#define UWTABLE (compiler.build.arch_os_target == MACOS_AARCH64 ? 1 : 2)
|
||||
#define EMIT_LOC(c, x) do { if (c->debug.builder) llvm_emit_debug_location(c, x->span); } while (0)
|
||||
#define EMIT_EXPR_LOC(c, x) do { if (c->debug.emit_expr_loc) llvm_emit_debug_location(c, x->span); } while (0)
|
||||
#define EMIT_EXPR_LOC(c, x) do { if (c->debug.builder) llvm_emit_debug_location(c, x->span); } while (0)
|
||||
#define EMIT_SPAN(c, x) do { if (c->debug.builder) llvm_emit_debug_location(c, x); } while (0)
|
||||
#define PUSH_DEFER_ERROR(val__) LLVMValueRef def_err__ = c->defer_error_var; c->defer_error_var = val__
|
||||
#define POP_DEFER_ERROR() c->defer_error_var = def_err__
|
||||
|
||||
Reference in New Issue
Block a user