浏览代码

Make solang build with inkwell 0.1.0-beta.5 (#1082)

Cyrill Leutwiler 3 年之前
父节点
当前提交
449bd6a26c
共有 5 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      src/emit/cfg.rs
  2. 1 1
      src/emit/instructions.rs
  3. 1 1
      src/emit/loop_builder.rs
  4. 1 1
      src/emit/mod.rs
  5. 1 1
      src/emit/solana/target.rs

+ 1 - 1
src/emit/cfg.rs

@@ -220,7 +220,7 @@ pub(super) fn create_block<'a>(
     block_no: usize,
     block_no: usize,
     bin: &Binary<'a>,
     bin: &Binary<'a>,
     cfg: &ControlFlowGraph,
     cfg: &ControlFlowGraph,
-    function: FunctionValue,
+    function: FunctionValue<'a>,
     ns: &Namespace,
     ns: &Namespace,
 ) -> BasicBlock<'a> {
 ) -> BasicBlock<'a> {
     let cfg_bb = &cfg.blocks[block_no];
     let cfg_bb = &cfg.blocks[block_no];

+ 1 - 1
src/emit/instructions.rs

@@ -1198,7 +1198,7 @@ fn add_or_retrieve_block<'a>(
     block_no: usize,
     block_no: usize,
     pos: inkwell::basic_block::BasicBlock<'a>,
     pos: inkwell::basic_block::BasicBlock<'a>,
     bin: &Binary<'a>,
     bin: &Binary<'a>,
-    function: FunctionValue,
+    function: FunctionValue<'a>,
     blocks: &mut HashMap<usize, BasicBlock<'a>>,
     blocks: &mut HashMap<usize, BasicBlock<'a>>,
     work: &mut VecDeque<Work<'a>>,
     work: &mut VecDeque<Work<'a>>,
     w: &mut Work<'a>,
     w: &mut Work<'a>,

+ 1 - 1
src/emit/loop_builder.rs

@@ -22,7 +22,7 @@ pub struct LoopBuilder<'a> {
 impl<'a> LoopBuilder<'a> {
 impl<'a> LoopBuilder<'a> {
     /// Create a new loop. This creates the basic blocks and inserts a branch to start of the loop at
     /// Create a new loop. This creates the basic blocks and inserts a branch to start of the loop at
     /// the current location. This function should be called first.
     /// the current location. This function should be called first.
-    pub fn new(binary: &Binary<'a>, function: FunctionValue) -> Self {
+    pub fn new(binary: &Binary<'a>, function: FunctionValue<'a>) -> Self {
         let entry_block = binary.builder.get_insert_block().unwrap();
         let entry_block = binary.builder.get_insert_block().unwrap();
         let condition_block = binary.context.append_basic_block(function, "cond");
         let condition_block = binary.context.append_basic_block(function, "cond");
         let body_block = binary.context.append_basic_block(function, "body");
         let body_block = binary.context.append_basic_block(function, "body");

+ 1 - 1
src/emit/mod.rs

@@ -104,7 +104,7 @@ pub trait TargetRuntime<'a> {
         binary: &Binary<'a>,
         binary: &Binary<'a>,
         ty: &ast::Type,
         ty: &ast::Type,
         slot: &mut IntValue<'a>,
         slot: &mut IntValue<'a>,
-        function: FunctionValue,
+        function: FunctionValue<'a>,
         ns: &ast::Namespace,
         ns: &ast::Namespace,
     ) -> BasicValueEnum<'a>;
     ) -> BasicValueEnum<'a>;
 
 

+ 1 - 1
src/emit/solana/target.rs

@@ -540,7 +540,7 @@ impl<'a> TargetRuntime<'a> for SolanaTarget {
         binary: &Binary<'a>,
         binary: &Binary<'a>,
         ty: &ast::Type,
         ty: &ast::Type,
         slot: &mut IntValue<'a>,
         slot: &mut IntValue<'a>,
-        function: FunctionValue,
+        function: FunctionValue<'a>,
         ns: &ast::Namespace,
         ns: &ast::Namespace,
     ) -> BasicValueEnum<'a> {
     ) -> BasicValueEnum<'a> {
         let data = self.contract_storage_data(binary);
         let data = self.contract_storage_data(binary);