mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-15 04:31:08 +00:00
llvm-context: alloca at the function entry if possible (#283)
Closes #48 Change the code size test to no longer emit debug info as to get a more accurate picture. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -101,9 +101,6 @@ where
|
||||
solidity_data: Option<SolidityData>,
|
||||
/// The Yul data.
|
||||
yul_data: Option<YulData>,
|
||||
|
||||
/// Hints whether the contracts deploy function stores immutables.
|
||||
immutables: bool,
|
||||
}
|
||||
|
||||
impl<'ctx, D> Context<'ctx, D>
|
||||
@@ -266,8 +263,6 @@ where
|
||||
|
||||
solidity_data: None,
|
||||
yul_data: None,
|
||||
|
||||
immutables: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -755,7 +750,9 @@ where
|
||||
address: inkwell::values::IntValue<'ctx>,
|
||||
) -> anyhow::Result<Pointer<'ctx>> {
|
||||
let address_type = self.integer_type(revive_common::BIT_LENGTH_ETH_ADDRESS);
|
||||
let address_pointer = self.build_alloca_at_entry(address_type, "address_pointer");
|
||||
let address_pointer = self
|
||||
.get_global(crate::polkavm::GLOBAL_ADDRESS_SPILL_BUFFER)?
|
||||
.into();
|
||||
let address_truncated =
|
||||
self.builder()
|
||||
.build_int_truncate(address, address_type, "address_truncated")?;
|
||||
@@ -1431,14 +1428,4 @@ where
|
||||
pub fn optimizer_settings(&self) -> &OptimizerSettings {
|
||||
self.optimizer.settings()
|
||||
}
|
||||
|
||||
/// Hint the deploy code exit routine to emit storing the immutables.
|
||||
pub fn enable_immutables(&mut self) {
|
||||
self.immutables = true;
|
||||
}
|
||||
|
||||
/// Returns if the contract stores or loads immutables.
|
||||
pub fn has_immutables(&self) -> bool {
|
||||
self.immutables
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user