Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 4369 boom #4401

Closed
wants to merge 16 commits into from
6 changes: 5 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
fail-fast: false
matrix:
include:
- image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20230806
- image: ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20230829
name: x86-64 Linux glibc
debugger: lldb
- image: ponylang/ponyc-ci-x86-64-unknown-linux-musl-builder:20230808
Expand All @@ -99,6 +99,10 @@ jobs:
image: ${{ matrix.image }}
options: --user pony --cap-add=SYS_PTRACE --security-opt seccomp=unconfined
steps:
- name: About clang
run: clang -v
- name: About cmake
run: cmake --version
- name: Checkout
uses: actions/checkout@v3
- name: Restore Libs Cache
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if(NOT DEFINED PONYC_VERSION)
endif()

# Uncomment this to show build commands
# set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_VERBOSE_MAKEFILE ON)

# We require C++14 (because LLVM does)
set(CMAKE_CXX_STANDARD 14)
Expand Down Expand Up @@ -258,6 +258,8 @@ else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 -Werror -Wconversion -Wno-sign-conversion -Wextra -Wall -Wno-unknown-warning-option ${PONY_PIC_FLAG} -fexceptions")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -fno-rtti ${PONY_PIC_FLAG} -fexceptions")
add_link_options(-rdynamic)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
endif()

if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin")
Expand Down
2 changes: 1 addition & 1 deletion src/libponyc/codegen/genopt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ static void optimise(compile_t* c, bool pony_specific)
if (c->opt->release) {
MPM = PB.buildPerModuleDefaultPipeline(OptimizationLevel::O3);
} else {
MPM = PB.buildO0DefaultPipeline(OptimizationLevel::O0);
MPM = PB.buildPerModuleDefaultPipeline(OptimizationLevel::O1);
Copy link
Member Author

Choose a reason for hiding this comment

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

This switches us back to "make the boom happen"

}

// Run the passes.
Expand Down
11 changes: 11 additions & 0 deletions src/libponyc/codegen/genreference.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ LLVMValueRef gen_localdecl(compile_t* c, ast_t* ast)
if(value != NULL)
return GEN_NOVALUE;

//printf("%s\n", name);

ast_t* type = deferred_reify(c->frame->reify, ast_type(id), c->opt);
reach_type_t* t = reach_type(c->reach, type);
ast_free_unattached(type);
Expand All @@ -254,6 +256,15 @@ LLVMValueRef gen_localdecl(compile_t* c, ast_t* ast)
// Store the alloca to use when we reference this local.
codegen_setlocal(c, name, alloc);

//if (strcmp(name, "t1") == 0 || strcmp(name, "t2") == 0) {
/*if (strcmp(name, "t1") == 0) {
ast_print(id, 80);
printf("%ld\n", ast_line(ast));
ast_print(ast, 80);
LLVMPositionBuilderAtEnd(c->builder, this_block);
return GEN_NOTNEEDED;
}*/

LLVMMetadataRef file = codegen_difile(c);
LLVMMetadataRef scope = codegen_discope(c);

Expand Down
10 changes: 10 additions & 0 deletions test/libponyc-run/runner/_tester.pony
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,16 @@ actor _Tester
i = i + 1
end
exit_code' = num.i32()?
else
// Some versions of lldb such as lldb 14 don't do "exited with status"
// but they do do "stop reason =". Unlike with "exited with status",
// we only get the stop reason if there was an error.
// We know this impacts lldb 14 and 15. 17 works like earlier lldb
// versions. We haven't tested with lldb 16.
try
let idx1 = _out_buf.find("stop reason =")?
exit_code' = -1
end
end
end

Expand Down
Loading