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
13 changes: 9 additions & 4 deletions .github/workflows/llvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,22 @@ jobs:
- {llvm_version: 18, runs-on: ubuntu-24.04, codename: noble}
- {llvm_version: 19, runs-on: ubuntu-24.04, codename: noble}
- {llvm_version: 20, runs-on: ubuntu-24.04, codename: noble}
name: "LLVM ${{ matrix.llvm_version }}"
- {runs-on: ubuntu-24.04, codename: noble}
name: "LLVM ${{ matrix.llvm_version || 'Nightly' }}"
steps:
- name: Checkout Crystal source
uses: actions/checkout@v4

- name: Install LLVM ${{ matrix.llvm_version }}
- name: Install LLVM ${{ matrix.llvm_version || 'Nightly' }}
run: |
sudo apt remove 'llvm-*' 'libllvm*'
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo apt-add-repository -y deb http://apt.llvm.org/${{ matrix.codename }}/ llvm-toolchain-${{ matrix.codename }}-${{ matrix.llvm_version }} main
sudo apt install -y llvm-${{ matrix.llvm_version }}-dev lld
sudo apt-add-repository -y \
deb \
http://apt.llvm.org/${{ matrix.codename }}/ \
llvm-toolchain-${{ matrix.codename }}${{ matrix.llvm_version && format('-{0}', matrix.llvm_version) || '' }} \
main
sudo apt install -y llvm${{ matrix.llvm_version && format('-{0}', matrix.llvm_version) || '' }}-dev lld

- name: Install Crystal
uses: crystal-lang/install-crystal@v1
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/codegen/codegen.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2544,7 +2544,7 @@ module Crystal
name = "'#{name}'"
key = StringKey.new(@llvm_mod, str)
@strings[key] ||= begin
global = @llvm_mod.globals.add(@llvm_typer.llvm_string_type(str.bytesize), name)
global = @llvm_mod.globals.add(@llvm_typer.llvm_string_type(str.bytesize), name.gsub('\\', "\\\\"))
global.linkage = LLVM::Linkage::Private
global.global_constant = true
global.initializer = llvm_context.const_struct [
Expand Down
2 changes: 2 additions & 0 deletions src/llvm/enums.cr
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module LLVM
WillReturn
WriteOnly
ZExt
Captures

# NOTE: enum body does not allow `class_getter` or `TypeDeclaration`, hence
# the nil cast
Expand Down Expand Up @@ -91,6 +92,7 @@ module LLVM
kinds[ArgMemOnly] = kind_for_name("argmemonly")
kinds[Builtin] = kind_for_name("builtin")
kinds[ByVal] = kind_for_name("byval")
kinds[Captures] = kind_for_name("captures")
kinds[Cold] = kind_for_name("cold")
kinds[Convergent] = kind_for_name("convergent")
kinds[Dereferenceable] = kind_for_name("dereferenceable")
Expand Down
2 changes: 1 addition & 1 deletion src/llvm/ext/llvm-versions.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.1 19.1 18.1 17.0 16.0 15.0 14.0 13.0 12.0 11.1 11.0 10.0 9.0 8.0
21.0 20.1 19.1 18.1 17.0 16.0 15.0 14.0 13.0 12.0 11.1 11.0 10.0 9.0 8.0
1 change: 1 addition & 0 deletions src/llvm/lib_llvm.cr
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
IS_LT_180 = {{compare_versions(LibLLVM::VERSION, "18.0.0") < 0}}
IS_LT_190 = {{compare_versions(LibLLVM::VERSION, "19.0.0") < 0}}
IS_LT_200 = {{compare_versions(LibLLVM::VERSION, "20.0.0") < 0}}
IS_LT_210 = {{compare_versions(LibLLVM::VERSION, "21.0.0") < 0}}
end
{% end %}

Expand Down
Loading