suppress warnings about unused things

Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
xermicus
2024-03-12 18:16:12 +01:00
parent d12fa073fd
commit 6d058a42ed
15 changed files with 69 additions and 97 deletions
@@ -3,13 +3,10 @@
//!
use inkwell::types::BasicType;
use inkwell::values::BasicValue;
use crate::eravm::context::address_space::AddressSpace;
use crate::eravm::context::function::declaration::Declaration as FunctionDeclaration;
use crate::eravm::context::function::llvm_runtime::LLVMRuntime;
use crate::eravm::context::function::Function;
use crate::eravm::context::pointer::Pointer;
use crate::eravm::context::Context;
use crate::eravm::Dependency;
use crate::eravm::WriteLLVM;
@@ -27,6 +24,7 @@ pub struct DefaultCall {
name: String,
}
#[allow(unused)]
impl DefaultCall {
/// The gas argument index.
pub const ARGUMENT_INDEX_GAS: usize = 0;
@@ -3,7 +3,6 @@
//!
use inkwell::types::BasicType;
use inkwell::values::BasicValue;
use crate::eravm::context::address_space::AddressSpace;
use crate::eravm::context::function::Function;
@@ -121,7 +120,7 @@ where
let value_join_block = context.append_basic_block("deployer_call_value_join_block");
context.set_basic_block(context.current_function().borrow().entry_block());
let abi_data = crate::eravm::utils::abi_data(
let _abi_data = crate::eravm::utils::abi_data(
context,
input_offset,
input_length,
@@ -17,7 +17,7 @@ pub fn create_context(
let module = llvm.create_module("test");
let optimizer = Optimizer::new(optimizer_settings);
Context::<DummyDependency>::new(&llvm, module, optimizer, None, true, None)
Context::<DummyDependency>::new(llvm, module, optimizer, None, true, None)
}
#[test]
+4 -33
View File
@@ -2,10 +2,6 @@
//! Translates the cryptographic operations.
//!
use inkwell::values::BasicValue;
use crate::eravm::context::address_space::AddressSpace;
use crate::eravm::context::function::Function as EraVMFunction;
use crate::eravm::context::Context;
use crate::eravm::Dependency;
@@ -13,37 +9,12 @@ use crate::eravm::Dependency;
/// Translates the `sha3` instruction.
///
pub fn sha3<'ctx, D>(
context: &mut Context<'ctx, D>,
offset: inkwell::values::IntValue<'ctx>,
length: inkwell::values::IntValue<'ctx>,
_context: &mut Context<'ctx, D>,
_offset: inkwell::values::IntValue<'ctx>,
_length: inkwell::values::IntValue<'ctx>,
) -> anyhow::Result<inkwell::values::BasicValueEnum<'ctx>>
where
D: Dependency + Clone,
{
Ok(offset.into())
/*
let offset_pointer = context.builder().build_int_to_ptr(
offset,
context.byte_type().ptr_type(AddressSpace::Heap.into()),
"sha3_offset_pointer",
)?;
Ok(context
.build_invoke(
context.llvm_runtime().sha3,
&[
offset_pointer.as_basic_value_enum(),
length.as_basic_value_enum(),
context
.bool_const(
context
.get_function(EraVMFunction::ZKSYNC_NEAR_CALL_ABI_EXCEPTION_HANDLER)
.is_some(),
)
.as_basic_value_enum(),
],
"sha3_call",
)
.expect("Always exists"))
*/
todo!()
}
+4 -7
View File
@@ -2,9 +2,6 @@
//! Translates a log or event call.
//!
use inkwell::values::BasicValue;
use crate::eravm::context::address_space::AddressSpace;
use crate::eravm::context::Context;
use crate::eravm::Dependency;
@@ -18,10 +15,10 @@ use crate::eravm::Dependency;
/// accept two at once.
///
pub fn log<'ctx, D>(
context: &mut Context<'ctx, D>,
input_offset: inkwell::values::IntValue<'ctx>,
input_length: inkwell::values::IntValue<'ctx>,
topics: Vec<inkwell::values::IntValue<'ctx>>,
_context: &mut Context<'ctx, D>,
_input_offset: inkwell::values::IntValue<'ctx>,
_input_length: inkwell::values::IntValue<'ctx>,
_topics: Vec<inkwell::values::IntValue<'ctx>>,
) -> anyhow::Result<()>
where
D: Dependency + Clone,
@@ -64,15 +64,6 @@ impl TargetMachine {
///
pub fn set_target_data(&self, module: &inkwell::module::Module) {
module.set_triple(&self.target_machine.get_triple());
let data_layout = self
.target_machine
.get_target_data()
.get_data_layout()
.as_str()
.to_str()
.expect("datalayout sting should be valid")
.to_owned();
module.set_data_layout(&self.target_machine.get_target_data().get_data_layout());
}