Skip to content

Commit

Permalink
Experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Nov 12, 2023
1 parent 289fc86 commit 0a87db2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/std/core/builtin.c3
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ struct CallstackElement
uint line;
}

fn bool print_backtrace(String message, int backtraces_to_ignore) @if(env::DARWIN || env::LINUX)
fn bool print_backtrace(String message, int backtraces_to_ignore) @if(env::DARWIN)
{
@pool()
{
BacktraceList! backtrace = backtrace::backtrace_load(mem::temp());
BacktraceList! backtrace = darwin::backtrace_load(mem::temp());
if (catch backtrace) return false;
if (backtrace.len() <= backtraces_to_ignore) return false;
io::eprint("\nERROR: '");
Expand Down
3 changes: 0 additions & 3 deletions lib/std/os/backtrace.c3
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ fn void Backtrace.free(&self)
self.allocator.free(self.file);
}

def backtrace_load = darwin::backtrace_load @if(env::DARWIN);
def backtrace_load = linux::backtrace_load @if(env::LINUX);

fn Backtrace* Backtrace.init(&self, uptr offset, String function, String object_file, String file = "", uint line = 0, Allocator* using = mem::heap())
{
if (!using)
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/llvm_codegen_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void gencontext_begin_module(GenContext *c)
LLVMStructSetBody(c->debug.stack_type, types, 5, false);
c->debug.current_stack_ptr = NULL;
c->debug.enable_stacktrace = true;
c->debug.emulated_stacktrace = !os_supports_stacktrace(platform_target.os);
c->debug.emulated_stacktrace = !os_is_apple(platform_target.os);
}
}
c->global_builder = LLVMCreateBuilder();
Expand Down

0 comments on commit 0a87db2

Please sign in to comment.