Skip to content

Commit

Permalink
Add lazy evaluation, fix I/O bugs, refactor, add docs & license
Browse files Browse the repository at this point in the history
  • Loading branch information
kowaalczyk committed Jan 7, 2020
1 parent ed4d2b5 commit bac1411
Show file tree
Hide file tree
Showing 17 changed files with 412 additions and 285 deletions.
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# source this file on OSX to use the Homebrew LLVM installation

export LLVM_ASSEMBLER$(brew --prefix llvm)/bin/llvm-as
export LLVM_LINKER=$(brew --prefix llvm)/bin/llvm-link
export LLVM_INTERPRETER=$(brew --prefix llvm)/bin/lli
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
*.realout

# executables
latc
latc_llvm
44 changes: 3 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
# compiler executables
name = "latc_llvm"
version = "0.1.0"
version = "0.2.0"
authors = ["Krzysztof Kowalczyk <[email protected]>"]
edition = "2018"

Expand All @@ -15,9 +15,8 @@ members = [".", "latte_lib"]

[dependencies]
# actual compiler & frontend logic implementation
latte_lib = {path = "latte_lib", version = "0.1.0"}
latte_lib = {path = "latte_lib", version = "0.2.0"}

[dev-dependencies]
# compile-time embedding of files from source directories, used for testing
include_dir = "0.4.1"
rstest = "0.5"
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Krzysztof Kowalczyk

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
all: test release

test: test-cargo test-e2e

runtime:
clang -S -std=c99 -o lib/runtime.ll lib/runtime.c -emit-llvm
clang -S -std=c99 -O2 -o lib/runtime.ll lib/runtime.c -emit-llvm
llvm-as -o lib/runtime.bc lib/runtime.ll

test:
test-cargo: runtime
cargo test --all -- --exact

test-e2e: runtime
bash test_e2e.sh

release: runtime
cargo build --package latc_llvm --bin latc_llvm --release
cp target/release/latc_llvm ./
cp latc_llvm latc
chmod +x latc_llvm latc
Loading

0 comments on commit bac1411

Please sign in to comment.