mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-20 01:01:08 +00:00
Separate compilation and linker phases (#376)
Separate between compilation and linker phases to allow deploy time linking and back-porting era compiler changes to fix #91. Unlinked contract binaries (caused by missing libraries or missing factory dependencies in turn) are emitted as raw ELF object. Few drive by fixes: - #98 - A compiler panic on missing libraries definitions. - Fixes some incosistent type forwarding in JSON output (empty string vs. null object). - Remove the unused fallback for size optimization setting. - Remove the broken `--lvm-ir` mode. - CI workflow fixes. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com> Signed-off-by: xermicus <bigcyrill@hotmail.com> Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
@@ -5,7 +5,6 @@ use inkwell::values::BasicValue;
|
||||
|
||||
use crate::polkavm::context::address_space::AddressSpace;
|
||||
use crate::polkavm::context::Context;
|
||||
use crate::PolkaVMDependency;
|
||||
|
||||
/// The LLVM global value.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
@@ -18,15 +17,14 @@ pub struct Global<'ctx> {
|
||||
|
||||
impl<'ctx> Global<'ctx> {
|
||||
/// A shortcut constructor.
|
||||
pub fn new<D, T, V>(
|
||||
context: &mut Context<'ctx, D>,
|
||||
pub fn new<T, V>(
|
||||
context: &mut Context<'ctx>,
|
||||
r#type: T,
|
||||
address_space: AddressSpace,
|
||||
initializer: V,
|
||||
name: &str,
|
||||
) -> Self
|
||||
where
|
||||
D: PolkaVMDependency + Clone,
|
||||
T: BasicType<'ctx>,
|
||||
V: BasicValue<'ctx>,
|
||||
{
|
||||
@@ -53,14 +51,13 @@ impl<'ctx> Global<'ctx> {
|
||||
}
|
||||
|
||||
/// Construct an external global.
|
||||
pub fn declare<D, T>(
|
||||
context: &mut Context<'ctx, D>,
|
||||
pub fn declare<T>(
|
||||
context: &mut Context<'ctx>,
|
||||
r#type: T,
|
||||
address_space: AddressSpace,
|
||||
name: &str,
|
||||
) -> Self
|
||||
where
|
||||
D: PolkaVMDependency + Clone,
|
||||
T: BasicType<'ctx>,
|
||||
{
|
||||
let r#type = r#type.as_basic_type_enum();
|
||||
|
||||
Reference in New Issue
Block a user