Skip to content

Commit

Permalink
Implement the module mapping pass
Browse files Browse the repository at this point in the history
This pass runs an analysis of LLVM modules to resolve all top-level
entities. The results are written out as pass data, and are intended for
use as part of a consistency check during the compilation to FLO.

As part of implementing this pass, this commit also implements:

- A proxy for the portions of the LLVM type system that we support,
  enabling us to do pre- and during-compilation consistency checking
  where necessary.
- A parser for LLVM's data-layout specifications, allowing us to ensure
  that the provided modules are not making any assumptions that would be
  unsafe for our target machine.
  • Loading branch information
iamrecursion committed Oct 18, 2024
1 parent d10215f commit 03556a2
Show file tree
Hide file tree
Showing 21 changed files with 3,003 additions and 1,964 deletions.
1,715 changes: 167 additions & 1,548 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ rust-version = "1.81.0"
[workspace.dependencies]
anyhow = "1.0.89"
ariadne = "0.4.1"
cairo-lang-compiler = "2.8.2"
cairo-lang-debug = "2.8.2"
cairo-lang-diagnostics = "2.8.2"
cairo-lang-eq-solver = "2.8.2"
cairo-lang-lowering = "2.8.2"
cairo-lang-semantic = "2.8.2"
cairo-lang-sierra-generator = "2.8.2"
cairo-lang-utils = "2.8.2"
clap = "4.5.16"
inkwell = { version = "0.5.0", features = ["llvm18-0"] }
itertools = "0.13.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! This is the CLI driver for the compilation of LLVM IR to Cairo. For more
//! detail, please see the documentation for the crate [`ltc_compiler`].
//! detail, please see the documentation for the [`ltc_compiler`] crate.
#![warn(clippy::all, clippy::cargo, clippy::pedantic)]
#![allow(clippy::module_name_repetitions)] // Allows for better API naming
Expand Down
5 changes: 1 addition & 4 deletions crates/compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ rust-version.workspace = true

[dependencies]
bimap = "0.6.3"
cairo-lang-compiler.workspace = true
cairo-lang-debug.workspace = true
cairo-lang-lowering.workspace = true
cairo-lang-semantic.workspace = true
chumsky = "0.9.3"
clap.workspace = true
derivative = "2.2.0"
downcast-rs = "1.2.1"
Expand Down
193 changes: 0 additions & 193 deletions crates/compiler/src/compile/mod.rs

This file was deleted.

81 changes: 0 additions & 81 deletions crates/compiler/src/compile/pass/analysis/module_map.rs

This file was deleted.

Loading

0 comments on commit 03556a2

Please sign in to comment.