Skip to content

Commit

Permalink
Experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Nov 13, 2023
1 parent 1f4bbba commit 116b908
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/compiler/llvm_codegen_function.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,15 @@ void llvm_emit_body(GenContext *c, LLVMValueRef function, FunctionPrototype *pro
llvm_emit_stacktrace_definitions(c);
c->builder = prev_builder;
}
else if (c->debug.enable_stacktrace)
{
const char *name = ".stacktrace_current";
LLVMValueRef current_stack = c->debug.current_stack_ptr = llvm_add_global_raw(c, name, c->ptr_type, 0);
LLVMSetThreadLocal(current_stack, true);
LLVMSetInitializer(current_stack, llvm_get_zero_raw(c->ptr_type));
llvm_set_weak(c, current_stack);
c->builder = prev_builder;
}
c->opt_var = NULL;
c->catch_block = NULL;

Expand Down

0 comments on commit 116b908

Please sign in to comment.