-
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.
- Loading branch information
1 parent
052fbd7
commit 6b47b36
Showing
16 changed files
with
170 additions
and
293 deletions.
There are no files selected for viewing
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
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; | ||
|
||
|
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//! | ||
//! The LLVM IR EVMLA function trait. | ||
//! | ||
|
||
use crate::context::function::block::key::Key as BlockKey; | ||
use crate::context::function::block::Block; | ||
|
||
/// | ||
/// The LLVM IR EVMLA function trait. | ||
/// | ||
pub trait IEVMLAFunction<'ctx> { | ||
/// | ||
/// Returns the block with the specified tag and initial stack pattern. | ||
/// | ||
/// If there is only one block, it is returned unconditionally. | ||
/// | ||
fn find_block(&self, key: &BlockKey, stack_hash: &md5::Digest) -> anyhow::Result<Block<'ctx>>; | ||
} |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
|
||
pub mod address_space; | ||
pub mod evmla_data; | ||
pub mod evmla_function; |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.