-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor for support of multiple targets (#16)
Initial support of the EVM target (#9)
- Loading branch information
1 parent
0dc0215
commit f1ae37a
Showing
92 changed files
with
5,770 additions
and
1,195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//! | ||
//! The LLVM context constants. | ||
//! | ||
|
||
/// The LLVM framework version. | ||
pub const LLVM_VERSION: semver::Version = semver::Version::new(15, 0, 4); |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
//! | ||
|
||
pub mod evmla_data; | ||
pub mod key; | ||
|
||
use self::evmla_data::EVMLAData; | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//! | ||
//! The LLVM function EVM legacy assembly data. | ||
//! | ||
|
||
use std::collections::BTreeMap; | ||
|
||
use crate::context::function::block::key::Key as BlockKey; | ||
use crate::context::function::block::Block; | ||
|
||
/// | ||
/// The LLVM function EVM legacy assembly data. | ||
/// | ||
/// Describes some data that is only relevant to the EVM legacy assembly. | ||
/// | ||
#[derive(Debug)] | ||
pub struct EVMLAData<'ctx> { | ||
/// The ordinary blocks with numeric tags. | ||
/// Is only used by the Solidity EVM compiler. | ||
pub blocks: BTreeMap<BlockKey, Vec<Block<'ctx>>>, | ||
/// The function stack size. | ||
pub stack_size: usize, | ||
} | ||
|
||
impl<'ctx> EVMLAData<'ctx> { | ||
/// | ||
/// A shortcut constructor. | ||
/// | ||
pub fn new(stack_size: usize) -> Self { | ||
Self { | ||
blocks: BTreeMap::new(), | ||
stack_size, | ||
} | ||
} | ||
|
||
/// | ||
/// Inserts a function block. | ||
/// | ||
pub fn insert_block(&mut self, key: BlockKey, block: Block<'ctx>) { | ||
if let Some(blocks) = self.blocks.get_mut(&key) { | ||
blocks.push(block); | ||
} else { | ||
self.blocks.insert(key, vec![block]); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//! | ||
//! The common LLVM function entities. | ||
//! | ||
|
||
pub mod block; | ||
pub mod declaration; | ||
pub mod evmla_data; | ||
pub mod r#return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.