Skip to content
Merged
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
16 changes: 6 additions & 10 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run:
go test -v -tags=llvm${{ matrix.llvm }}
- name: Test default LLVM
if: matrix.llvm == 21
if: matrix.llvm == 22
run:
go test -v
test-linux:
Expand All @@ -52,7 +52,7 @@ jobs:
run:
go test -v -tags=llvm${{ matrix.llvm }}
- name: Test default LLVM
if: matrix.llvm == 21
if: matrix.llvm == 22
run:
go test -v
test-windows:
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
gcc --version
go test -v -tags=llvm${{ matrix.llvm }}
- name: Test default LLVM
if: matrix.llvm == 21
if: matrix.llvm == 22
shell: msys2 {0}
run: |
set -euo pipefail
Expand All @@ -187,21 +187,17 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
llvm: [19, 20, 21]
container: fedora:43
llvm: [22]
container: fedora:44
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies (default LLVM)
if: matrix.llvm == 21
run: dnf install --assumeyes g++ golang llvm-devel
- name: Install dependencies (older LLVM)
if: matrix.llvm != 21
run: dnf install --assumeyes g++ golang llvm${{ matrix.llvm }}-devel
- name: Test LLVM ${{ matrix.llvm }}
run:
go test -v -tags=llvm${{ matrix.llvm }}
- name: Test default LLVM
if: matrix.llvm == 21
if: matrix.llvm == 22
run:
go test -v
4 changes: 2 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Currently supported:
* LLVM 22, 21, 20, 19, 18, 17, 16, 15 and 14 in an MSYS2 MINGW64 environment on Windows (see the setup below).
* Any of the above versions with a manually built LLVM through the `byollvm` build tag. You need to set up `CFLAGS`/`LDFLAGS` etc yourself in this case.

LLVM 21 is selected by default. You can select another LLVM version using a
LLVM 22 is selected by default. You can select another LLVM version using a
build tag, for example `-tags=llvm19` to use LLVM 19.

## Usage
Expand All @@ -30,7 +30,7 @@ You can use build tags to select a LLVM version. For example, use `-tags=llvm15`
### Windows (MSYS2 MINGW64)

The Windows bindings expect `pkg-config` metadata named after the selected LLVM
major version, such as `llvm-21`. After installing a MinGW-compatible LLVM,
major version, such as `llvm-22`. After installing a MinGW-compatible LLVM,
`mingw-w64-x86_64-gcc`, and `mingw-w64-x86_64-pkgconf` in a MINGW64
environment, generate that file from `llvm-config`:

Expand Down
4 changes: 2 additions & 2 deletions llvm_config_llvm21.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !byollvm && !llvm14 && !llvm15 && !llvm16 && !llvm17 && !llvm18 && !llvm19 && !llvm20 && !llvm22
// +build !byollvm,!llvm14,!llvm15,!llvm16,!llvm17,!llvm18,!llvm19,!llvm20,!llvm22
//go:build !byollvm && llvm21
// +build !byollvm,llvm21

package llvm

Expand Down
2 changes: 1 addition & 1 deletion llvm_config_llvm22.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build !byollvm && llvm22
//go:build !byollvm && (llvm22 || (!llvm14 && !llvm15 && !llvm16 && !llvm17 && !llvm18 && !llvm19 && !llvm20 && !llvm21))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P3] Build-tag consistency: //go:build-only files vs go.mod 1.14

This file's build constraint now uses only //go:build, with no legacy // +build fallback — same for switch_llvm22.go and switch_pre22.go. go.mod declares go 1.14, and Go toolchains before 1.17 ignore //go:build lines entirely. On such a toolchain these constraints would be dropped, causing duplicate symbols (e.g. two GetSwitchCaseValue definitions) and a build failure.

This is a pre-existing condition (the switch/llvm22 files already lacked // +build in the base), not a regression introduced here — and CI pins Go 1.22, so it's invisible to the test matrix. But since this PR is already editing these constraint lines, it's a good moment to make the intent explicit: either add matching // +build lines to these three files (the sibling llvm_config_llvm19/20/21.go still carry both forms), or bump go.mod to go 1.17 and drop the now-dead // +build lines everywhere for a uniform style. Low severity / optional.


package llvm

Expand Down
2 changes: 1 addition & 1 deletion switch_llvm22.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build llvm22
//go:build llvm22 || (!llvm14 && !llvm15 && !llvm16 && !llvm17 && !llvm18 && !llvm19 && !llvm20 && !llvm21)

package llvm

Expand Down
2 changes: 1 addition & 1 deletion switch_pre22.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build !llvm22
//go:build llvm14 || llvm15 || llvm16 || llvm17 || llvm18 || llvm19 || llvm20 || llvm21

package llvm

Expand Down
Loading