Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/llvm/forward-declare-c.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ declare %Pos @c_get_arg(i64)
declare void @c_io_println(%Pos)
declare %Pos @c_io_readln()

declare void @hole(i8*)
declare void @duplicated_prompt()
declare void @hole(i8*) cold
declare void @duplicated_prompt() cold
Comment on lines +9 to +10
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My hypothesis is that the hole (panic: not implemented yet) being cold doesn't matter at all, but the duplicated_prompt might by a tiny bit since I assuming used stacks are non-null seems good...


declare %Pos @c_ref_fresh(%Pos)
declare %Pos @c_ref_get(%Pos)
Expand Down
2 changes: 2 additions & 0 deletions libraries/llvm/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
// this should _morally_ be using `stderr`, but we don't tee it in tests
// see PR #823 & issue #815 for context

__attribute__((cold))
void hole(const char* message) {
printf("PANIC: %s not implemented yet\n", message);
exit(1);
}

__attribute__((cold))
void duplicated_prompt() {
printf("PANIC: Continuation invoked itself\n");
exit(1);
Expand Down
2 changes: 1 addition & 1 deletion libraries/llvm/rts.ll
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ define private void @invalidate(%Stack %stack, %Stack %end) {

error:
call void @duplicated_prompt()
ret void
unreachable

check:
%isEnd = icmp eq %Stack %next, %end
Expand Down