Skip to content

Commit 25c896d

Browse files
committed
bump: LLVM 11.0.1 & inkwell beta.2
1 parent 05a77aa commit 25c896d

File tree

128 files changed

+605
-594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+605
-594
lines changed

.github/actions-rs/grcov.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/actions/install-llvm/dist/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,14 +1182,15 @@ async function execute(cmd) {
11821182
(async () => {
11831183
try {
11841184
if(isLinux) {
1185-
await exec.exec("sudo apt install llvm-8 llvm-8-* liblld-8*");
1185+
const installScript = path.join(__dirname, "../../../../scripts/install-llvm.sh");
1186+
await exec.exec(`sudo ${installScript}`);
11861187
} else if(isMacOS) {
1187-
await exec.exec("brew install llvm@8")
1188-
let llvmPath = await execute("brew --prefix llvm@8");
1188+
await exec.exec("brew install llvm@11")
1189+
let llvmPath = await execute("brew --prefix llvm@11");
11891190
core.addPath(`${llvmPath}/bin`)
11901191
} else if(isWindows) {
1191-
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v8.0.1/llvm-8.0.1-windows-x64-msvc16.7z"
1192-
core.info(`Downloading LLVM from '${downloadUrl}'`)
1192+
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v11.0.1/llvm-11.0.1-windows-x64-msvc16.7z"
1193+
core.info(`downloading LLVM from '${downloadUrl}'`)
11931194
const downloadLocation = await tc.downloadTool(downloadUrl);
11941195

11951196
core.info("Succesfully downloaded LLVM release, extracting...")

.github/actions/install-llvm/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ export async function execute(cmd) {
3030
(async () => {
3131
try {
3232
if(isLinux) {
33-
await exec.exec("sudo apt install llvm-8 llvm-8-* liblld-8*");
33+
const installScript = path.join(__dirname, "../../../../scripts/install-llvm.sh");
34+
await exec.exec(`sudo ${installScript}`);
3435
} else if(isMacOS) {
35-
await exec.exec("brew install llvm@8")
36-
let llvmPath = await execute("brew --prefix llvm@8");
36+
await exec.exec("brew install llvm@11")
37+
let llvmPath = await execute("brew --prefix llvm@11");
3738
core.addPath(`${llvmPath}/bin`)
3839
} else if(isWindows) {
39-
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v8.0.1/llvm-8.0.1-windows-x64-msvc16.7z"
40-
core.info(`Downloading LLVM from '${downloadUrl}'`)
40+
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v11.0.1/llvm-11.0.1-windows-x64-msvc16.7z"
41+
core.info(`downloading LLVM from '${downloadUrl}'`)
4142
const downloadLocation = await tc.downloadTool(downloadUrl);
4243

4344
core.info("Succesfully downloaded LLVM release, extracting...")

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
artifacts: "mun libmun_runtime.so"
2424
}
2525
- {
26-
os: "windows-2016",
26+
os: "windows-latest",
2727
dir: win64,
2828
artifacts: "mun.exe mun_runtime.dll mun_runtime.dll.lib"
2929
}

README.md

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
- **Cross compilation** - The Mun compiler is able to compile to all supported
6363
target platforms from any supported compiler platform.
6464

65-
- **Powerful IDE integration** *not implemented yet* - The Mun language and
66-
compiler framework are designed to support source code queries, allowing for
67-
powerful IDE integrations such as code completion and refactoring tools.
65+
- **Powerful IDE integration** - The Mun language and compiler framework are
66+
designed to support source code queries, allowing for powerful IDE
67+
integrations such as code completion and refactoring tools.
6868

6969
## Example
7070

@@ -153,53 +153,40 @@ rustup](https://www.rust-lang.org/tools/install).
153153

154154
#### LLVM
155155

156-
Mun targets LLVM 8.0.1. Installing LLVM is platform dependant and as such can be
157-
a pain. The following steps are how we install LLVM on [our CI
156+
Mun targets LLVM 11. Installing LLVM is platform dependant and as such can be
157+
a pain.
158+
159+
The following steps are how we install LLVM on [our CI
158160
runners](.github/actions/install-llvm/index.js):
159161

160-
* ***nix**: Package managers of recent *nix distros can install binary versions
161-
of LLVM, e.g.:
162-
```bash
163-
# Ubuntu 18.04
164-
sudo apt install llvm-8 llvm-8-* liblld-8*
165-
```
166-
* **Arch Linux** The binary version of LLVM can currently only be installed
167-
using an AUR helper, such as `yay`:
162+
* ***Debian/Ubuntu**: Execute the script in
163+
[`scripts/install-llvm.sh`](scripts/install-llvm.sh) to install the required
164+
LLVM packages from the official APT repository.
168165
```bash
169-
yay -Syu lld7-headers lld7-libs-static
166+
./scripts/install-llvm.sh
170167
```
171-
It is also possible to perform a manual package installation as follows:
172-
```bash
173-
# NOTE: this installs all of the lld7 packages
174-
cd /tmp
175-
git clone https://aur.archlinux.org/lld7.git
176-
cd lld7
177-
makepkg -si
178-
```
179-
When running `llvm-config`, an error can occur signalling that
180-
`/usr/lib/libtinfo.so.5` is missing. If a newer version is present, create a
181-
symlink; e.g. `ln -s /usr/lib/libtinfo.so.6 /usr/lib/libtinfo.so.5`),
182-
otherwise download the library.
183168
* **macOS**: [Brew](https://brew.sh/) contains a binary distribution of LLVM
184-
8.0.1. However, as it's not the latest version, it won't be added to the path.
169+
11. However, when it's not the latest version, it won't be added to the path.
185170
We are using [llvm-sys](https://crates.io/crates/llvm-sys) to manage version,
186-
but another option is to export the `LLVM_SYS_80_PREFIX` variable, which will
171+
but another option is to export the `LLVM_SYS_110_PREFIX` variable, which will
187172
not clutter your `PATH`. To install:
188173
```bash
189-
brew install llvm@8
174+
brew install llvm@11
190175
# Export LLVM_SYS_PREFIX to not clubber PATH
191-
export LLVM_SYS_PREFIX=$(brew --prefix llvm@8)
176+
export LLVM_SYS_PREFIX=$(brew --prefix llvm@11)
192177
```
193-
* **windows**: Binary distrubutions are available for Windows on the LLVM
178+
* **windows**: Binary distributions are available for Windows on the LLVM
194179
website, but they do not contain a number of libraries that are required by
195180
Mun. To avoid having to go to the trouble of compiling LLVM yourself, we
196181
created a [repository](https://github.com/mun-lang/llvm-package-windows) that
197182
automatically compiles the required binaries. It also contains a
198-
[release](https://github.com/mun-lang/llvm-package-windows/releases/v8.0.1)
183+
[release](https://github.com/mun-lang/llvm-package-windows/releases/v11.0.1)
199184
that you can download and extract to your machine. Once downloaded and
200185
extracted, add the `<extract_dir>/bin` folder to the `PATH` environment
201186
variable.
202187

188+
Otherwise, your best bet is to build LLVM from source.
189+
203190
### Clone source
204191

205192
```bash

crates/mun_codegen/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ hir = { version = "=0.2.0", path = "../mun_hir", package = "mun_hir" }
1919
itertools = "0.9.0"
2020
mun_codegen_macros = { path = "../mun_codegen_macros", package = "mun_codegen_macros" }
2121
mun_target = { version = "=0.2.0", path = "../mun_target" }
22-
mun_lld = { version = "=80.0.0", path = "../mun_lld" }
22+
mun_lld = { path = "../mun_lld" }
2323
anyhow = "1.0.31"
2424
thiserror = "1.0.19"
2525
salsa = "0.15.0"
@@ -28,7 +28,7 @@ array-init="0.1.0"
2828
tempfile = "3"
2929
paste = "0.1.6"
3030
parking_lot = "0.10"
31-
inkwell = { version = "=0.1.0-beta.2", features = ["llvm8-0", "no-libffi-linking"]}
31+
inkwell = { version = "=0.1.0-beta.2", features = ["llvm11-0", "no-libffi-linking"]}
3232
by_address = "1.0.4"
3333

3434
[dev-dependencies]

crates/mun_codegen/src/snapshots/mun_codegen__test__arithmetic_op_f32.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ source_filename = "main.mun"
1010

1111
@global_type_table = external global [1 x %"mun_codegen::ir::types::TypeInfo"*]
1212

13-
define float @add(float, float) {
13+
define float @add(float %0, float %1) {
1414
body:
1515
%add = fadd float %0, %1
1616
ret float %add
1717
}
1818

19-
define float @subtract(float, float) {
19+
define float @subtract(float %0, float %1) {
2020
body:
2121
%sub = fsub float %0, %1
2222
ret float %sub
2323
}
2424

25-
define float @multiply(float, float) {
25+
define float @multiply(float %0, float %1) {
2626
body:
2727
%mul = fmul float %0, %1
2828
ret float %mul
2929
}
3030

31-
define float @divide(float, float) {
31+
define float @divide(float %0, float %1) {
3232
body:
3333
%div = fdiv float %0, %1
3434
ret float %div
3535
}
3636

37-
define float @remainder(float, float) {
37+
define float @remainder(float %0, float %1) {
3838
body:
3939
%rem = frem float %0, %1
4040
ret float %rem

crates/mun_codegen/src/snapshots/mun_codegen__test__arithmetic_op_f64.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ source_filename = "main.mun"
1010

1111
@global_type_table = external global [1 x %"mun_codegen::ir::types::TypeInfo"*]
1212

13-
define double @add(double, double) {
13+
define double @add(double %0, double %1) {
1414
body:
1515
%add = fadd double %0, %1
1616
ret double %add
1717
}
1818

19-
define double @subtract(double, double) {
19+
define double @subtract(double %0, double %1) {
2020
body:
2121
%sub = fsub double %0, %1
2222
ret double %sub
2323
}
2424

25-
define double @multiply(double, double) {
25+
define double @multiply(double %0, double %1) {
2626
body:
2727
%mul = fmul double %0, %1
2828
ret double %mul
2929
}
3030

31-
define double @divide(double, double) {
31+
define double @divide(double %0, double %1) {
3232
body:
3333
%div = fdiv double %0, %1
3434
ret double %div
3535
}
3636

37-
define double @remainder(double, double) {
37+
define double @remainder(double %0, double %1) {
3838
body:
3939
%rem = frem double %0, %1
4040
ret double %rem

crates/mun_codegen/src/snapshots/mun_codegen__test__arithmetic_op_i128.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ source_filename = "main.mun"
1010

1111
@global_type_table = external global [1 x %"mun_codegen::ir::types::TypeInfo"*]
1212

13-
define i128 @add(i128, i128) {
13+
define i128 @add(i128 %0, i128 %1) {
1414
body:
1515
%add = add i128 %0, %1
1616
ret i128 %add
1717
}
1818

19-
define i128 @subtract(i128, i128) {
19+
define i128 @subtract(i128 %0, i128 %1) {
2020
body:
2121
%sub = sub i128 %0, %1
2222
ret i128 %sub
2323
}
2424

25-
define i128 @multiply(i128, i128) {
25+
define i128 @multiply(i128 %0, i128 %1) {
2626
body:
2727
%mul = mul i128 %0, %1
2828
ret i128 %mul
2929
}
3030

31-
define i128 @divide(i128, i128) {
31+
define i128 @divide(i128 %0, i128 %1) {
3232
body:
3333
%div = sdiv i128 %0, %1
3434
ret i128 %div
3535
}
3636

37-
define i128 @remainder(i128, i128) {
37+
define i128 @remainder(i128 %0, i128 %1) {
3838
body:
3939
%rem = srem i128 %0, %1
4040
ret i128 %rem

crates/mun_codegen/src/snapshots/mun_codegen__test__arithmetic_op_i16.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ source_filename = "main.mun"
1010

1111
@global_type_table = external global [1 x %"mun_codegen::ir::types::TypeInfo"*]
1212

13-
define i16 @add(i16, i16) {
13+
define i16 @add(i16 %0, i16 %1) {
1414
body:
1515
%add = add i16 %0, %1
1616
ret i16 %add
1717
}
1818

19-
define i16 @subtract(i16, i16) {
19+
define i16 @subtract(i16 %0, i16 %1) {
2020
body:
2121
%sub = sub i16 %0, %1
2222
ret i16 %sub
2323
}
2424

25-
define i16 @multiply(i16, i16) {
25+
define i16 @multiply(i16 %0, i16 %1) {
2626
body:
2727
%mul = mul i16 %0, %1
2828
ret i16 %mul
2929
}
3030

31-
define i16 @divide(i16, i16) {
31+
define i16 @divide(i16 %0, i16 %1) {
3232
body:
3333
%div = sdiv i16 %0, %1
3434
ret i16 %div
3535
}
3636

37-
define i16 @remainder(i16, i16) {
37+
define i16 @remainder(i16 %0, i16 %1) {
3838
body:
3939
%rem = srem i16 %0, %1
4040
ret i16 %rem

0 commit comments

Comments
 (0)