Skip to content

Commit c8e238b

Browse files
committed
Eliminate some errors/warnings following rebase
1 parent c8a2256 commit c8e238b

File tree

5 files changed

+15
-26
lines changed

5 files changed

+15
-26
lines changed

src/emit/stylus/mod.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,12 @@ impl StylusTarget {
3636
);
3737

3838
let args = bin.module.add_global(
39-
bin.context.i8_type().ptr_type(AddressSpace::default()),
39+
bin.context.ptr_type(AddressSpace::default()),
4040
Some(AddressSpace::default()),
4141
"args",
4242
);
4343
args.set_linkage(Linkage::Internal);
44-
args.set_initializer(
45-
&bin.context
46-
.i8_type()
47-
.ptr_type(AddressSpace::default())
48-
.get_undef(),
49-
);
44+
args.set_initializer(&bin.context.ptr_type(AddressSpace::default()).get_undef());
5045

5146
bin.args = Some(args);
5247

@@ -160,9 +155,9 @@ impl StylusTarget {
160155

161156
fn declare_externals(&self, bin: &Binary) {
162157
let ctx = bin.context;
163-
let u8_ptr = ctx.i8_type().ptr_type(AddressSpace::default()).into();
158+
let u8_ptr = ctx.ptr_type(AddressSpace::default()).into();
164159
let u16_val = ctx.i16_type().into();
165-
let u32_ptr = ctx.i32_type().ptr_type(AddressSpace::default()).into();
160+
let u32_ptr = ctx.ptr_type(AddressSpace::default()).into();
166161
let u32_val = ctx.i32_type().into();
167162
let u64_val = ctx.i64_type().into();
168163

src/emit/stylus/storage.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl StorageSlot for StylusTarget {
170170
.builder
171171
.build_int_to_ptr(
172172
bin.context.i32_type().const_all_ones(),
173-
bin.context.i8_type().ptr_type(AddressSpace::default()),
173+
bin.context.ptr_type(AddressSpace::default()),
174174
"invalid",
175175
)
176176
.unwrap();
@@ -309,12 +309,7 @@ impl StorageSlot for StylusTarget {
309309
let ret = self.get_storage_type_int(bin, function, slot_ptr, ptr_ty, &storage_type);
310310

311311
bin.builder
312-
.build_int_to_ptr(
313-
ret,
314-
bin.llvm_type(ty.deref_any())
315-
.ptr_type(AddressSpace::default()),
316-
"",
317-
)
312+
.build_int_to_ptr(ret, bin.context.ptr_type(AddressSpace::default()), "")
318313
.unwrap()
319314
.into()
320315
}
@@ -400,8 +395,7 @@ impl StorageSlot for StylusTarget {
400395
if elem_ty.is_reference_type(bin.ns)
401396
&& !elem_ty.deref_memory().is_fixed_reference_type(bin.ns)
402397
{
403-
let load_ty =
404-
bin.llvm_type(elem_ty).ptr_type(AddressSpace::default());
398+
let load_ty = bin.context.ptr_type(AddressSpace::default());
405399
elem = bin
406400
.builder
407401
.build_load(load_ty, elem, "")
@@ -619,7 +613,7 @@ impl StorageSlot for StylusTarget {
619613
if field.ty.is_reference_type(bin.ns)
620614
&& !field.ty.is_fixed_reference_type(bin.ns)
621615
{
622-
let load_ty = bin.llvm_type(&field.ty).ptr_type(AddressSpace::default());
616+
let load_ty = bin.context.ptr_type(AddressSpace::default());
623617
elem = bin
624618
.builder
625619
.build_load(load_ty, elem, field.name_as_str())

src/emit/stylus/target.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ impl<'a> TargetRuntime<'a> for StylusTarget {
423423
.builder
424424
.build_pointer_cast(
425425
chunk_ptr,
426-
bin.context.i8_type().ptr_type(AddressSpace::default()),
426+
bin.context.ptr_type(AddressSpace::default()),
427427
"chunk_ptr_as_byte_ptr",
428428
)
429429
.unwrap();
@@ -545,7 +545,7 @@ impl<'a> TargetRuntime<'a> for StylusTarget {
545545
.builder
546546
.build_pointer_cast(
547547
chunk_ptr,
548-
bin.context.i8_type().ptr_type(AddressSpace::default()),
548+
bin.context.ptr_type(AddressSpace::default()),
549549
"chunk_ptr_as_byte_ptr",
550550
)
551551
.unwrap();
@@ -643,7 +643,7 @@ impl<'a> TargetRuntime<'a> for StylusTarget {
643643
fn return_code<'b>(&self, bin: &'b Binary, ret: IntValue<'b>) {
644644
emit_context!(bin);
645645

646-
self.assert_failure(bin, byte_ptr!().const_zero(), i32_zero!());
646+
self.assert_failure(bin, ptr!().const_zero(), i32_zero!());
647647
}
648648

649649
/// Return failure without any result
@@ -997,7 +997,7 @@ impl<'a> TargetRuntime<'a> for StylusTarget {
997997
let args = bin
998998
.builder
999999
.build_load(
1000-
bin.context.i8_type().ptr_type(AddressSpace::default()),
1000+
bin.context.ptr_type(AddressSpace::default()),
10011001
bin.args.unwrap().as_pointer_value(),
10021002
"args",
10031003
)
@@ -1226,7 +1226,7 @@ impl<'a> TargetRuntime<'a> for StylusTarget {
12261226

12271227
topic_buf
12281228
} else {
1229-
byte_ptr!().const_null()
1229+
ptr!().const_null()
12301230
};
12311231

12321232
call!(

tests/lir_tests/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub(crate) fn identifier(id: usize) -> Operand {
104104
}
105105
}
106106

107-
pub fn new_printer(v: &Vartable) -> Printer {
107+
pub fn new_printer(v: &Vartable) -> Printer<'_> {
108108
Printer::new(v)
109109
}
110110

tests/solana.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ impl VirtualMachine {
14741474
res
14751475
}
14761476

1477-
fn function(&mut self, name: &str) -> VmFunction {
1477+
fn function(&mut self, name: &str) -> VmFunction<'_, '_> {
14781478
let idx = if let Some((idx, _)) = self.stack[0]
14791479
.idl
14801480
.as_ref()

0 commit comments

Comments
 (0)