Remove vyper and dead code (#23)

This commit is contained in:
Cyrill Leutwiler
2024-06-05 13:29:07 +02:00
committed by GitHub
parent a04eacabff
commit 9e9227d740
18 changed files with 34 additions and 422 deletions
@@ -2,10 +2,8 @@
use std::marker::PhantomData;
use crate::polkavm::context::address_space::AddressSpace;
use crate::polkavm::context::code_type::CodeType;
use crate::polkavm::context::function::runtime::Runtime;
use crate::polkavm::context::pointer::Pointer;
use crate::polkavm::context::function::runtime;
use crate::polkavm::context::Context;
use crate::polkavm::Dependency;
use crate::polkavm::WriteLLVM;
@@ -47,7 +45,7 @@ where
let function_type =
context.function_type::<inkwell::types::BasicTypeEnum>(vec![], 0, false);
context.add_function(
Runtime::FUNCTION_DEPLOY_CODE,
runtime::FUNCTION_DEPLOY_CODE,
function_type,
0,
Some(inkwell::module::Linkage::External),
@@ -57,26 +55,10 @@ where
}
fn into_llvm(self, context: &mut Context<D>) -> anyhow::Result<()> {
context.set_current_function(Runtime::FUNCTION_DEPLOY_CODE)?;
context.set_current_function(runtime::FUNCTION_DEPLOY_CODE)?;
context.set_basic_block(context.current_function().borrow().entry_block());
context.set_code_type(CodeType::Deploy);
if let Some(vyper) = context.vyper_data.as_ref() {
for index in 0..vyper.immutables_size() / revive_common::BYTE_LENGTH_WORD {
let offset = (crate::polkavm::r#const::HEAP_AUX_OFFSET_CONSTRUCTOR_RETURN_DATA
as usize)
+ (1 + index) * 2 * revive_common::BYTE_LENGTH_WORD;
let value = index * revive_common::BYTE_LENGTH_WORD;
let pointer = Pointer::new_with_offset(
context,
AddressSpace::HeapAuxiliary,
context.word_type(),
context.word_const(offset as u64),
"immutable_index_initializer",
);
context.build_store(pointer, context.word_const(value as u64))?;
}
}
self.inner.into_llvm(context)?;
match context