diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 17426a8526..ed43e8cbb5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -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 @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a747e82b0..6bbcacc409 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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") diff --git a/src/libponyc/codegen/genopt.cc b/src/libponyc/codegen/genopt.cc index f72be1a552..b0f5a6b70b 100644 --- a/src/libponyc/codegen/genopt.cc +++ b/src/libponyc/codegen/genopt.cc @@ -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); } // Run the passes. diff --git a/src/libponyc/codegen/genreference.c b/src/libponyc/codegen/genreference.c index caeceb40ac..d8855ba761 100644 --- a/src/libponyc/codegen/genreference.c +++ b/src/libponyc/codegen/genreference.c @@ -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); @@ -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); diff --git a/test/libponyc-run/runner/_tester.pony b/test/libponyc-run/runner/_tester.pony index 46c0212fa5..a0bb223a7c 100644 --- a/test/libponyc-run/runner/_tester.pony +++ b/test/libponyc-run/runner/_tester.pony @@ -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