From f57a9a2b2cd65a7ee37aacc84abcdd2cd97a265f Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Sun, 28 Apr 2024 13:35:47 +0200 Subject: Fix CI --- .github/workflows/ci.yml | 13 ++++++------- .github/workflows/nightly.yml | 7 +++++-- src/odin/printer/visit.odin | 8 +++++++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c946a1..7caf12d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,12 +43,11 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup Dependencies - if: matrix.os == 'ubuntu-20.04' - # LLVM 12 and 11 are pre-installed on GitHub runners. On ubuntu-20.04, LLVM 12 - # is available as version 12.0.0 whilst Odin requires 12.0.1. It would try to use - # LLVM 12 by default and CI would fail. Therefore we'll remove it to use LLVM 11. - run: sudo apt update && sudo apt purge -qq -y llvm-12 clang-12 - - name: Buid Odin + run: wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 17 + echo "/usr/lib/llvm-17/bin" >> $GITHUB_PATH + - name: Build Odin run: | git clone --depth 1 https://github.com/odin-lang/Odin cd Odin && ./build_odin.sh release @@ -58,7 +57,7 @@ jobs: macos: strategy: matrix: - os: [macos-12, macos-latest] + os: [macos-13] fail-fast: false runs-on: ${{ matrix.os }} timeout-minutes: 15 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2237b58..ea92fa7 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -38,7 +38,7 @@ jobs: path: ./dist dist-x86_64-darwin: - runs-on: macos-latest + runs-on: macos-13 timeout-minutes: 15 steps: - uses: actions/checkout@v1 @@ -73,7 +73,10 @@ jobs: steps: - uses: actions/checkout@v1 - name: Download LLVM - run: sudo apt update && sudo apt purge -qq -y llvm-12 clang-12 + run: wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 17 + echo "/usr/lib/llvm-17/bin" >> $GITHUB_PATH - name: Download Odin run: | git clone https://github.com/odin-lang/Odin diff --git a/src/odin/printer/visit.odin b/src/odin/printer/visit.odin index 8354aab..f21eeaa 100644 --- a/src/odin/printer/visit.odin +++ b/src/odin/printer/visit.odin @@ -1160,7 +1160,13 @@ visit_stmt :: proc( ) } - + //Special case for when the if statement ends with a call expression + /* + if my_function( + + ) { + } + */ if v.init != nil && is_value_decl_statement_ending_with_call(v.init) || v.init != nil && is_assign_statement_ending_with_call(v.init) || v.cond != nil && v.init == nil && is_value_expression_call(v.cond) { -- cgit v1.2.3