Skip to content

Commit

Permalink
Various optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Rog3rSm1th committed Jun 11, 2024
1 parent 4660d37 commit 74e9560
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@
resolver = "2"
members = [
"sierra-decompiler",
]
]

[profile.dev]
opt-level = 0

[profile.release]
opt-level = 3
1 change: 1 addition & 0 deletions lib/src/decompiler/decompiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ impl<'a> Decompiler<'a> {
}

/// Generate a callgraph representation in DOT Format
#[inline]
pub fn generate_callgraph(&mut self) -> String {
process_callgraph(&self.functions)
}
Expand Down
1 change: 0 additions & 1 deletion lib/src/decompiler/libfuncs_patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ lazy_static! {
// Used to match and replace them in remote contracts
pub static ref TYPE_ID_REGEX: Regex = Regex::new(r"(?<type_id>\[[0-9]+\])").unwrap();

// User-defined type ID
// User defined types IDs are the 250 first bits of the id name Keccak hash
// https://github.com/starkware-libs/cairo/blob/b29f639c2090822914f52db6696d71748a8b93a6/crates/cairo-lang-sierra/src/ids.rs#L118
pub static ref USER_DEFINED_TYPE_ID_REGEX: Regex = Regex::new(r"ut@\[(?<type_id>[0-9]+)\]").unwrap();
Expand Down
1 change: 1 addition & 0 deletions lib/src/decompiler/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::decompiler::libfuncs_patterns::USER_DEFINED_TYPE_ID_REGEX;

/// Convert an integer to it's string value or hex value
/// Used to decode consts
#[inline]
pub fn decode_hex_bigint(bigint: &BigInt) -> Option<String> {
// Convert the BigInt to a hexadecimal string
let hex_string = format!("{:x}", bigint);
Expand Down

0 comments on commit 74e9560

Please # to comment.